Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rwieruch/node-express-mongodb-server
Basic Node with Express + MongoDB Server
https://github.com/rwieruch/node-express-mongodb-server
express express-js expressjs mongodb mongodb-database mongoose node node-js nodejs
Last synced: 3 months ago
JSON representation
Basic Node with Express + MongoDB Server
- Host: GitHub
- URL: https://github.com/rwieruch/node-express-mongodb-server
- Owner: rwieruch
- Created: 2019-01-04T15:00:36.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-11T14:32:20.000Z (11 months ago)
- Last Synced: 2024-09-26T17:21:27.718Z (4 months ago)
- Topics: express, express-js, expressjs, mongodb, mongodb-database, mongoose, node, node-js, nodejs
- Language: JavaScript
- Homepage: https://robinwieruch.de
- Size: 202 KB
- Stars: 77
- Watchers: 7
- Forks: 47
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Simple Node with Express + MongoDB Server
[![Build Status](https://travis-ci.org/rwieruch/node-express-mongodb-server.svg?branch=master)](https://travis-ci.org/rwieruch/node-express-mongodb-server) [![Slack](https://slack-the-road-to-learn-react.wieruch.com/badge.svg)](https://slack-the-road-to-learn-react.wieruch.com/) [![Greenkeeper badge](https://badges.greenkeeper.io/rwieruch/node-express-mongodb-server.svg)](https://greenkeeper.io/)
An easy way to get started with a Express server with MongoDB with Node.js. [Read more about it.](https://www.robinwieruch.de/mongodb-express-setup-tutorial/)
## Features
- Express
- REST API
- MongoDB## Requirements
- [node & npm](https://nodejs.org/en/)
- [git](https://www.robinwieruch.de/git-essential-commands/)## Installation
- `git clone [email protected]:rwieruch/node-express-mongodb-server.git`
- `cd node-express-mongodb-server`
- `npm install`
- [start MongoDB](https://www.robinwieruch.de/mongodb-express-setup-tutorial/)
- `npm start`
- optional: include _.env_ in your _.gitignore_### GET Routes
- visit http://localhost:3000
- /messages
- /messages/1
- /users
- /users/1### Beyond GET Routes
#### CURL
- 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`#### Postman
- Install [Postman](https://www.getpostman.com/apps) 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