A Node, Mongo, Express and Passport Boilerplate with Bearer Authentication for my personal projects.
- Run
brew update
- Run
brew install mongodb
- Run
sudo mkdir -p /data/db
then enter your password - Run
sudo chown -R 'id -un' /data/db
then enter your password - Run
mongod
- Open a new terminal window and run
mongo
- Run
use (Database name goes here)
- Run
mongod
- Open a new terminal window and run
mongo
- Run
use (Database name goes here)
Add a new folder under the root directory called config
. This folder will have a file called keys.js
. This file will contain the following:
module.exports = {
googleClientId: <YOUR_GOOGLE_API_CLIENT_ID>
googleClientSecret: <YOUR_GOOGLE_API_CLIENT_SECRET>
db: {
local: <YOUR_LOCAL_MONGODB_URI>
...
prod: <YOUR_LOCAL_MONGODB_URI>
}
cookieSecret: <ANY_STRING_YOU_WANT>
}
- Run
npm install
- Run
npm start