Skip to content

md-asnawi/URL-Shortener

Repository files navigation

URL-Shortener

Web Application which converts long URL to short URL. Unable to get application deployment using Heroku on time but attempt can be seen from the heroku-deployment branch. Given more time, it would have definitely been possible. Should have looked into AWS deployment instead because of familiarity from school course work. Nevertheless, it was a good experience and I had no regrets.

Tech Stack

  • NodeJS, ExpressJS
  • HTML, CSS, JavaScript
  • MySQL

How to Run Application

  1. Create a new MySQL Schema and use the url_shortener.sql file to import the relevant table in
  2. Create a .env file with contents as follows: DB_PASSWORD="_____" and insert your MySQL password accordingly
  3. Run npm install to install the relevant dependencies required for the application
  4. Open the terminal and run the app using "npm run start"
  5. Head over to browser and type "http://localhost:3000"
  6. Enjoy! :)

For Unit Testing

  1. Head over to app.test.js to check out unit test
  2. Open the terminal and run the test using "npm run test"

Packages Info

Packages:

  • express for routing
  • config to manage config files
  • nanoid v3 for generating short code
  • valid-url to verify url
  • dotenv to retrieve environment variables in .env file
  • cors for cross-origin resource sharing
  • nodemon is used for node to restart app when changes are made (development purposes, not for production)
  • jest & supertest for testing (development purposes, not for production)

Issues:

References/Credits:

About

Web Application which converts long URL to short URL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages