Skip to content

Servicio de acortamiento de enlaces web en español

Notifications You must be signed in to change notification settings

cesarferradas/linkeame

Repository files navigation

linkeame

A URL shortening service in Spanish.

Install

  1. Install Node

  2. Install nvm

  3. Use this project's Node version

    nvm use
  4. Install dependencies

    npm install
  5. Install MongoDB

  6. Start MongoDB in the background

    mongod --config /usr/local/etc/mongod.conf --fork
  7. Create admin account for authentication

    mongo
    > use admin
    switched to db admin
    > db.createUser({
          user: "monkey",
          pwd: "password",
          roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
      })
    
  8. Create a .env file in the project root, and set your environment variables

    cp .example.env .env
  9. Start the server

    npm start

Linting

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

Testing

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:

  1. Create a .env.test file and populate with test values (see .travis.yml)

    cp .example.env .env.test
  2. Run the test script

    npm test