How do I separate my angular front end from my node/express back-end with nginx on Digital Ocean?

March 24, 2015 2.2k views
Nginx Node.js

Currently and successfully I have a node.js app that lives on a Digital Ocean server. I have a single Github repo for the entire app. In my routes in express when a certain route is hit ('/') I render an EJS template which has my HTML/CSS/Angular. This works - but is not what I want.

What I want is to have my HTML/CSS/Angular completely separate from my node back-end.

I want that front-end to have its own Github repo. The problem I am running into is I am finding it hard to find resources that tell me how to set up my app this way - the tutorials I have found teach me how to do it the way I already have it done.

What I want:

  • A user enters a url and the appropriate html page is rendered (without using node/express)
  • My angular will then hit my back-end endpoints for whatever it needs

How do I:

  • Set up my single IP address server on Digital Ocean to do this?

Do I need to do anything specific for static file delivery? I am new to the world of server setup.

Be the first one to answer this question.