Question

How to access index.js on NextJS/Strapi

Posted February 23, 2021 442 views
StrapiNext.js

Hi, I am new to digital ocean/strapi and NextJS! I have created a strapi droplet and created a nextjs app. I can access strapi fine straight from the ip address, but cannot see how to access the nextjs app index.js.

Being inexperienced, to access the NextJS app, I have tried IP Adrress:3000 which doesn’t work. Can anyone please give me some pointers?

Thanks....

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

Hi,

Thanks for the response. The answer turns our to be straight forward. When the Strapi droplet is created, port 3000 (used for NextJS) is blocked. So all that is needed is to open the port using ‘ufw allow 3000’ and the port is open and then index.js can be accessed using yourIPAddress:3000

Thanks....

Hi @netsidedeveloper,

I completely understand you in regards to the NextJS application. I was the same in that regard. Having said that, DigitalOcean have pretty good documentation about how to get started with it, where you can find what’s needed for you and stuff like that. You can find that documentation here:

https://www.digitalocean.com/community/tech_talks/getting-started-with-next-js

Now, most probably you would need to install Nginx and configure it as a reverse proxy to your NextJS. I can provide you with simple steps or tutorials to follow but I would first recommend you checking the above documentation prior to actually going next to the Nginx stuff.

by Chris Sev
Learn why so many React developers are switching to using Next.js, an open source framework that helps you build production-grade React applications that scale.