forked from kylealwyn/node-rest-api-boilerplate
-
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.
add environment variables section to readme
- Loading branch information
Kyle Alwyn
committed
Jan 26, 2017
1 parent
011c928
commit 2672eb7
Showing
1 changed file
with
16 additions
and
17 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 |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|