diff --git a/README.md b/README.md index 7120ef1..426860a 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,11 @@ ## Node API -Application in Node, Express, MongoDB and PM2 to give support to Front End development, this application serving a bunch of AJAX requests to give and manipulate data from database. +### Description +Node API is production ready and open source project in Node, Express and MongoDB + +### Support +This application is hosted on Heroku and serve a bunch of AJAX requests to give and manipulate data from database and give a support to test front end applications ### Showcase @@ -12,7 +16,6 @@ Application in Node, Express, MongoDB and PM2 to give support to Front End devel |https://typescript-angular4.herokuapp.com/ | https://github.com/renanlopescoder/typescript-angular4 | |http://mobx-react.herokuapp.com/ | https://github.com/renanlopescoder/mobx-react | - ## Routes #### Projects @@ -73,23 +76,27 @@ Application in Node, Express, MongoDB and PM2 to give support to Front End devel - Routes ```./src/routes``` - Models ```./src/models``` - Actions ```./src/actions``` +- Services ```./src/services``` - Configurations of Express ```./config/express.js``` - Database configurations ```./config/database.js``` - Server configurations ```./server.js``` ## Configuring the API locally -- Download or clone the project access the project folder with the terminal and execute the CLI npm install. -- Run the server npm start (Nodemon) -- Access in your browser http://localhost:3000 +- Download or clone the project access the project folder with the terminal and execute the CLI npm install +- Config your database in ```./congig/database.js``` change ```mongoose.connect('mongodb://localhost/yourDatabaseName');``` +- Run the server in development mode npm run dev +- Ctrl + c to exit of logs and run pm2 kill to kill all process of pm2 +- Access in your browser http://localhost:3000/projects ## API Dependencies - Dependency express - https://www.npmjs.com/package/express - Dependency body-parser - https://www.npmjs.com/package/body-parser - Dependency cors - https://www.npmjs.com/package/cors -- Dependency express-load - https://www.npmjs.com/package/express-load +- Dependency consign - https://www.npmjs.com/package/consign - Dependency PM2 - http://pm2.keymetrics.io/ +- Dependency mongoose - https://www.npmjs.com/package/mongoose By: Renan Lopes diff --git a/package.json b/package.json index 9b41df0..f75cfd1 100755 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "rest_api_node", + "name": "node_api", "version": "2.1.0", - "description": "NodeJS REST API is a open code NodeJS Back End API", + "description": "Node API is production ready and open source project in Node, Express, MongoDB and PM2", "scripts": { "preinstall": "npm i -g pm2 && pm2 install pm2-logrotate", - "dev": "pm2 start server.js --watch", + "dev": "pm2 start server.js --watch && pm2 logs", "start": "node ./node_modules/.bin/pm2 start server.js" }, "author": "Renan Lopes", diff --git a/server.js b/server.js index 3edd587..0ae8ba4 100755 --- a/server.js +++ b/server.js @@ -5,5 +5,5 @@ require('./config/database'); const PORT = process.env.PORT || 3000; server.listen(PORT, () => { - console.log('Servidor Iniciado'); + console.log(`Server running on port ${PORT}`); });