Skip to content

Commit

Permalink
add environment variables section to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Alwyn committed Jan 26, 2017
1 parent 011c928 commit 2672eb7
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
> Tested on Node v6 and above
## Features
- [x] ES6 for javascript awesomeness
- [x] ES6 for the latest & greatest javascript awesomeness
- [x] [MongoDB](https://www.mongodb.com/) w/ [Mongoose](http://mongoosejs.com/) for data layer
- [x] Username/Email registration and authentication
- [x] Testing via [Mocha](https://mochajs.org/) & [Chai](http://chaijs.com/)
- [x] Test coverage via [Isparta](https://github.com/douglasduteil/isparta)
- [x] Username/Email registration and authentication

## Getting Started
First, ensure you have node and mongo installed on your system.


```sh
# clone it
git clone [email protected]:kylealwyn/node-rest-api-boilerplate.git
Expand All @@ -31,28 +30,28 @@ npm start
curl -H "Content-Type: application/json" -X POST -d '{"username":"jamesdean", "email": "[email protected]", "password":"password1"}' http://localhost:4567/users
```

## Commands
## Environment Variables
Place a `.env` file in the top level of the directory you've cloned. These variables will be automatically assigned to `process.env` when the application boots. It is gitignored by default as it's not good practice to store your environment variables in your remote repository.
Your `.env` file can look something like this:

- `npm start`
- Start live-reloading development server

- `npm test`
- Run test suite
```shell
MONGO_URI=mongo://somewhere:27017
SESSION_SECRET=lolthisissecret
```

- `npm run test:watch`
- Run test suite with auto-reloading
Now we can access one of these variables with something like `process.env.MONGO_URI`!

- `npm run coverage`
- Run test coverage
## NPM Scripts

- `npm run build`
- Generates production ready application in `./build`
- **`npm start`** - Start live-reloading development server
- **`npm test`** - Run test suite
- **`npm run test:watch`** - Run test suite with auto-reloading
- **`npm run coverage`** - Generate test coverage
- **`npm run build`** - Generate production ready application in `./build`

## Todo
- [ ] Add OAuth Login Support (Facebook, Twitter, Google)
- [ ] Add support for MySql or PostgreSQL (Possibly with sequelize)
- [x] Write tests to exemplify Mongo interactions
- [ ] Move all data retrieval logic into services to remove Mongo dependences in controllers
- [ ] Reset password functionality

## License
Expand Down

0 comments on commit 2672eb7

Please sign in to comment.