Skip to content

Commit

Permalink
add release instructions to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pbatey committed Nov 13, 2020
1 parent de44116 commit 6daec0d
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ Create an express middleware that implements a RESTful API.
## Use
I wanted to make it extremely simple to start a mongo-backed rest server, so `npm start` starts one. The `server.js` script employs many best-practices for rest servers such as using https, gzip, and method overrides.

To quickly run a mongo instance, I like to use docker

docker run --rm -d --name mongo -p 27017:27017 mongo:latest

Then you'll need to connect and create the `express-mongo-rest` database.

docker exec -it mongo mongo
> use express-mongo-rest
> exit

You can configure the following options in the .env file (uses [dotenv](https://www.npmjs.com/package/dotenv)):
* **DB** The url for the mongo database. Default is `mongodb://localhost:27017/express-rest-mongo`.
* **PORT** The port to listen on. Default is 3000.
Expand Down Expand Up @@ -140,10 +150,37 @@ Here's the list of recommendations from those articles. Items not yet supported
20. ~~Use token based authentication, transported over OAuth2 where delegation is needed~~
21. ~~Include response headers that facilitate caching~~

Creating a Release
------------------

1. Ensure all unit tests pass with `npm test`
2. Use `npm version major|minor|patch` to increment the version in _package.json_ and tag the release
3. Push the tags `git push origin master --tags`
4. Publish the release `npm publish ./`

### Major Release

npm version major
git push origin master --tags
npm publish ./

### Minor Release (backwards compatible changes)

npm version minor
git push origin master --tags
npm publish ./

### Patch Release (bug fix)

npm version patch
git push origin master --tags
npm publish ./

## Todo
* Address more best-practices in 'server.js'
* Add schama validation (swagger-spec? json-schema?)
* Add swagger.io for api documentation.
* Add user authentication and authorization to API access (node-oauth2-server?)
* Add rate limiting (express-limiter?)
* Add OAuth2 (node-oauth2-server?)
* Use mongojs instead of mongoskin

0 comments on commit 6daec0d

Please sign in to comment.