Skip to content

Jbonez87/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Url Shortener

Installation and Instructions

  1. Run npm i in root directory of the project

  2. If you already have MongoDB installed on your machine, feel free to create a .env file with MONGOURL, URLCOLLECTION, TEMP and PORT variables. It should look something like this:

  MONGOURL=YOUR_CONNECTION_STRING
  URLCOLLECTION=YOUR_COLLECTION_NAME
  PORT=YOUR_PORT
  TEMP=YOUR_BASE_URL

If you do not have MongoDB installed, please install it on your machine using the following links:

  1. Run npm run start to build and start the server

  2. Using Postman or Insomnia, send a JSON object to localhost:3000/api/shorturl. The JSON object should contain a originUrl key with the value of a valid url. Here's an example:

{
  "originUrl": "www.example.com"
}
  1. For ease of use, there's also a simple HTML page with a form that you can use to send requests to the Express Server. It's located in the /public directory. Try it out in your browser!

Running the tests

The npm t command will run all of the jest tests and display the test coverage in your terminal.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published