It's a new day, a new start, a new platform. Built to learn the MEAN Stack, forked from rwieruch and me.
- Express
- REST API
- MongoDB (Mongoose)
- node & npm
- [git]
git clone git@github.com:rwieruch/node-express-mongodb-server.gitcd node-express-mongodb-servernpm installinstall node dependencies- visit https://www.robinwieruch.de/minimal-node-js-babel-setup/
npm install nodemon --save-devnpm install @babel/core @babel/node --save-devnpm install @babel/preset-env --save-devnpm install dotenv --save
install mongodb dependenciesnpm install mongoose --save- visit https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/
brew tap mongodb/brewbrew install mongodb-community@6.0brew services start/stop mongodb-community@6.0
npm start- optional: include .env in your .gitignore
- visit http://localhost:3000
- /messages
- /users
- Create a message with:
curl -X POST -H "Content-Type:application/json" http://localhost:3000/messages -d '{"text":"Hi again, World"}'
- Delete a message with:
curl -X DELETE -H "Content-Type:application/json" http://localhost:3000/messages/1
- Install Postman to interact with REST API
- Create a message with:
- URL: http://localhost:3000/messages
- Method: POST
- Body: raw + JSON (application/json)
- Body Content:
{ "text": "Hi again, World" }
- Delete a message with:
- URL: http://localhost:3000/messages/1
- Method: DELETE