If you want to read general information about Any JSON CMS go here.
Any JSON CMS consists of two parts. Admin application server and API server. It is API server.
git clone [email protected]:evmizulin/cms-api.git
cd cms-api
npm install
In project root folder there are configuration file config.js
. Update it for your needs.
module.exports = {
config: {
isDemo: true,
email: 'email',
devApiUrl: 'http://localhost:8080',
prodApiUrl: 'prod-api-url',
devAppUrl: 'http://localhost:3000',
prodAppUrl: 'prod-app-url',
devApiServerHost: 'localhost',
prodApiServerHost: 'localhost',
devApiServerPort: 8080,
prodApiServerPort: 8080,
devMongoDbUrl: 'mongodb://localhost:27017/cms',
prodMongoDbUrl: 'mongodb://localhost:27017/cms',
},
}
All parameters that have dev
and prod
prefixes, will be used for development and production environments respectively.
isDemo
- there are several limitations of functionality of demo server, set flag to false and it will take off limitations;email
- this parameter will be passed asfrom
for Sendmail to send mails;apiUrl
- URL of this API server;appUrl
- URL of Admin application server;apiServerHost
- this parameter will be passed ashost
to run Node.js server;apiServerPort
- this parameter will be passed asport
to run Node.js server;mongoDbUrl
- this parameter will be passed tomongoose.connect
function to connect MongoDb. Read more.
To run API server in development environment:
npm start
You should see in console something like this:
2019-05-08T17:47:35.888Z listening on localhost:8080
To check if everything working fine, make:
curl http://localhost:8080/say-hello
To run API server in production environment:
npm run start.prod
You could see the logs in /logs
folder.