Any JSON CMS - API server
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 installIn project root folder there are configuration file config.js. Update it for your needs.
module.exports = {
config: {
isDemo: true,
email: '[email protected]',
devApiUrl: 'http://localhost:8080',
prodApiUrl: 'https://api.anyjsoncms.com',
devAppUrl: 'http://localhost:3000',
prodAppUrl: 'https://anyjsoncms.com',
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 anyjsoncms.com demo server, set flag to false and it will take off limitations;email- this parameter will be passed asfromfor Sendmail to send mails;apiUrl- URL of this API server;appUrl- URL of Admin application server;apiServerHost- this parameter will be passed ashostto run Node.js server;apiServerPort- this parameter will be passed asportto run Node.js server;mongoDbUrl- this parameter will be passed tomongoose.connectfunction to connect MongoDb. Read more.
To run API server in development environment:
npm startYou 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-helloTo run API server in production environment:
npm run start.prodYou could see the logs in /logs folder.