A simple URL shortener built with Express and MongoDB.
JavaScript HTML CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
models
public
routes
src
test
.babelrc
.gitignore
LICENSE
Procfile
README.md
config.js
gulpfile.babel.js
package.json
server.js

README.md

redirect

A simple URL shortener built with Express and MongoDB. Here's a link to redirect on heroku.

Getting Started

To run this app, you must have node & mongo installed.

  1. git clone https://github.com/mskalandunas/redirect.git
  2. npm install ; npm install gulp
  3. In one terminal tab - mkdir db ; mongod --dbpath=./db --smallfiles
  4. In another terminal - mongo
    • Type use redirect-dev
    • Followed by db.counters.insert({ _id: 'url_count', seq: 1 })
  5. In another tab - node server.js
  6. Finally in the last tab - gulp
  7. Open your browser and go to localhost:3000.

mongod --dbpath=./db --smallfiles, node server.js, and gulp(build or default) need to be running simultaneously in order to use this application locally.

mongod --dbpath=./db --smallfiles should be run before node server.js.

Testing

Please use the options below for test running:

  • For back end tests - mocha test/redirect-route-tests.js
  • For front end tests - open test/client/test-index.html

To-do

  • Serverside caching
  • minify JS
  • compression
  • add protection from submitting huge blocks of text
  • check for ways to block bad sites