In development, we run server and client separately.
In production, server serves built client from dist folder.
To test database operations locally, please install MongoDB.
Before running the app, please ensure that your MongoDB server is up.
Docs generated with swagger is located at /api-docs
on the server
Make sure that NODE_ENV
environment variable is set like this:
NODE_ENV=development
cp .env-example .env
Make sure to configure valid MONGODB_URL
npm install
npm run all
npm run server
npm run client
Make sure that NODE_ENV
environment variable is set like this:
NODE_ENV=production
and valid MONGODB_URL
is configured
npm run build
npm run start
I'm using my own middleware for cross origin resource sharing. CORS is required only for development because server and client are on different origins.
You can learn more here: https://github.com/ObradovicNikola/cors-cheatsheet