NodeJS How to seperate Web Server from API

NodeJS How to seperate Web Server from API
0.0 0

#1

Question

My application will need to serve static content and also expose an API for serving and posting data. How do I separate these into different NodeJS process/instances but have them use the same port and base URL

From what I’ve read, I could use Nginx to accomplish this but I’m worried about how I’ll deploy this to hosts like Heroku.

Thanks all.


#2

Did you do this project? (Image abstraction layer)

My GitHub repo


#3

No, why? My application is not on the Free Code Camp curriculum.


#4

Welcome to the Free Code Camp forum


#5

Thank you, though I’ve been here for a while?


#6

I just think this project covers the tasks you want doing with your application, maybe?


#7

It asks you to build a full stack application (which I am), but does not detail or require you to split the API from the web server. Though I think I may have figured it out.

Something like Niginx or Apache can be used as a proxy and from what I’ve read, they can be deployed to amazon AWS. I’ll give these a try.


#8

Valuable information in your answer and I really appreciate your work
Thank you