contenta_react_next icon indicating copy to clipboard operation
contenta_react_next copied to clipboard

How to integrate with ContentJS

Open fpoirier1 opened this issue 6 years ago • 4 comments

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

fpoirier1 avatar Jan 18 '19 14:01 fpoirier1

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 :)

spleshka avatar Jan 18 '19 15:01 spleshka

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.

fpoirier1 avatar Jan 18 '19 15:01 fpoirier1

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 avatar Jan 18 '19 15:01 spleshka

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.

spleshka avatar Jan 18 '19 18:01 spleshka