contentacms / contenta_react_next

React + Next.js implementation for Contenta
https://contenta-react-next.now.sh
14 stars 10 forks source link

How to integrate with ContentJS #1

Open fpoirier1 opened 5 years ago

fpoirier1 commented 5 years ago

Hello,

This is not a bug report but a question. I would like to know how do you integrate contenta_react_next with contentajs ?

I know there is a way to add customization to NextJS server (https://nextjs.org/docs/#custom-server-and-routing) but I am curious what your point of view on this.

Cheers

spleshka commented 5 years ago

Hi @fpoirier1, right now we don't tbh - it's connected just with the backend system. We'd like to hear more on how this can be done though :)

fpoirier1 commented 5 years ago

Okay so you were able to build a complete decoupled project with NextJs without using contentajs ? Sorry for asking those silly questions, it is my first contenta project.

spleshka commented 5 years ago

There are no silly questions in our industry, so no worries! Answering your question - yes, you can make requests straight to the backend without having to set up any additional proxy in-between (contentajs is sort of proxy).

You can look at the live project running on this codebase here https://contenta-react-next.now.sh and using network inspector check out where the requests go - you'll realize that they just go to the URL with Drupal installed with ContentaCMS profile.

spleshka commented 5 years ago

A side note: if you're looking to play a bit with next.js / contentacms, this repo might be a good start for you https://github.com/systemseed/drupal_reactjs_boilerplate.