-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a26ad99
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Express & ES6 REST API Boilerplate | ||
================================== | ||
|
||
This is a straightforward boilerplate for building REST APIs with ES6 and Express. | ||
|
||
- ES6 support via [babel](https://babeljs.io) | ||
- REST resources as middleware via [resource-router-middleware](https://github.com/developit/resource-router-middleware) | ||
- CORS support via [cors](https://github.com/troygoode/node-cors) | ||
- Body Parsing via [body-parser](https://github.com/expressjs/body-parser) | ||
|
||
> Tip: If you are using [Mongoose](https://github.com/Automattic/mongoose), you can automatically expose your Models as REST resources using [restful-mongoose](https://git.io/restful-mongoose). | ||
|
||
|
||
Getting Started | ||
--------------- | ||
|
||
```sh | ||
# clone it | ||
git clone [email protected]:developit/express-es6-rest-api.git | ||
cd express-es6-rest-api | ||
|
||
# Make it your own | ||
rm -rf .git && git init && npm init | ||
|
||
# Install dependencies | ||
npm install | ||
|
||
# Start development live-reload server | ||
PORT=8080 npm run dev | ||
|
||
# Start production server: | ||
PORT=8080 npm start | ||
``` | ||
Docker Support | ||
------ | ||
```sh | ||
cd express-es6-rest-api | ||
|
||
# Build your docker | ||
docker build -t es6/api-service . | ||
# ^ ^ ^ | ||
# tag tag name Dockerfile location | ||
|
||
# run your docker | ||
docker run -p 8080:8080 es6/api-service | ||
# ^ ^ | ||
# bind the port container tag | ||
# to your host | ||
# machine port | ||
|
||
``` | ||
|
||
License | ||
------- | ||
|
||
MIT |