A simple starter with frontend using Angular 4+ and API server with NodeJS and Express framework. Typescript is configured for both Frontend and API server.
Frontend is created using angular-cli. So we can use all of the angular-cli commands from client
folder.
This starter can be used in two different ways:
- Separate Frontend and API server.
- Both Frontend and API served through single node server in production.
- clone this repository
npm run app-install
-
npm run start
: Starts both frontend and API server as separate live reload server. Frontend usesng serve
underneath and API server usesnodemon
for live reload. -
npm run build
: Createsdist
folder in bothclient
andserver
folders. -
npm run start:prod
: Builds theclient
andserver
projects and starts it withNODE_ENV=production
. This by default setsexpress.static
toclient/dist
to use this node server to serve frontend also.