An Express.js API that takes a submitted URL and creates an alias URL that, if navigated to, will redirect to the original URL.
Inspired by the URL Shortener Microservice challenge as part of the curriculum for the APIs and Microservices Certification on freeCodeCamp.
- Express.js
- Mongoose
- MongoDB
- EJS
- CSS3
- JavaScript
- randomstring
- valid-url
- dotenv
- Normalize.css
- Google Fonts
- FontAwesome
- nodemon
View project demo at https://autumnchris-url-shortener-api.onrender.com/api.
After forking and cloning, navigate to the repository in your command line and install the NPM packages:
npm install
Create a .env
file in the root of the repository and add the following environment variables:
MONGO_URI=<your-mongodb-uri>
Run the following script in your command line if starting the repository in development mode:
npm run dev
Run the following script in your command line if starting the repository in production mode:
npm start
Once the server is running, go to http://localhost:3000
in your browser.