Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rwieruch/node-express-server-rest-api
Basic Node with Express Server with REST API
https://github.com/rwieruch/node-express-server-rest-api
boilerplate express express-js expressjs node node-js nodejs postman rest rest-api restful-api
Last synced: about 10 hours ago
JSON representation
Basic Node with Express Server with REST API
- Host: GitHub
- URL: https://github.com/rwieruch/node-express-server-rest-api
- Owner: rwieruch
- Created: 2018-11-14T02:47:10.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-14T08:06:45.000Z (5 months ago)
- Last Synced: 2024-10-29T23:13:49.987Z (14 days ago)
- Topics: boilerplate, express, express-js, expressjs, node, node-js, nodejs, postman, rest, rest-api, restful-api
- Language: JavaScript
- Homepage: https://www.robinwieruch.de/
- Size: 179 KB
- Stars: 125
- Watchers: 6
- Forks: 140
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Simple Node with Express Server with REST API
[![Build Status](https://travis-ci.org/rwieruch/node-express-server-rest-api.svg?branch=master)](https://travis-ci.org/rwieruch/node-express-server-rest-api) [![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-server-rest-api.svg)](https://greenkeeper.io/)
An easy way to get started with a Express server offering a REST API with Node.js. [Read more about it.](https://www.robinwieruch.de/node-express-server-rest-api)
## Features
- Express
- REST API## Requirements
- [node & npm](https://nodejs.org/en/)
- [git](https://www.robinwieruch.de/git-essential-commands/)## Installation
- `git clone [email protected]:rwieruch/node-express-server-rest-api.git`
- `cd node-express-server-rest-api`
- `npm install`
- `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