A URL shortening REST API.
-
Install Docker
-
Create a
.env
file in the project root, and set your environment variablescp .example.env .env
-
Run app
docker-compose up --build
-
Install Node
-
Install nvm
-
Use this project's Node version
nvm use
-
Install dependencies
npm install
-
Install MongoDB
-
Start MongoDB in the background
mongod --config /usr/local/etc/mongod.conf --fork
-
Create admin account for authentication
mongo
> use admin switched to db admin > db.createUser({ user: "monkey", pwd: "password", roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] })
-
Create a
.env
file in the project root, and set your environment variablescp .example.env .env
-
Start the server
npm start
ESLint is configured to run automatically as a pre-commit hook. It follows the Airbnb JavaScript Style Guide.
You can run linting manually with:
npm run lint
Tests run with Mocha and code coverage is reported
with Istanbul. Tests live under the test/
directory, which is Mocha's default path.
To run the test suite:
-
Create a
.env.test
file and populate with test values (see.travis.yml
)cp .example.env .env.test
-
Run the test script
npm test
See Issues for outstanding work, and feel free to suggest features!