Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/surojcodes/pocketurl
A full stack Javascript URL shortening app following API first approach using Node js (Express), MongoDB (mongoose ) and axios.
https://github.com/surojcodes/pocketurl
api axios expressjs fullstack-javascript javascript mongodb mongoose nodejs
Last synced: about 1 month ago
JSON representation
A full stack Javascript URL shortening app following API first approach using Node js (Express), MongoDB (mongoose ) and axios.
- Host: GitHub
- URL: https://github.com/surojcodes/pocketurl
- Owner: surojcodes
- Created: 2020-06-15T08:46:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-13T02:00:53.000Z (about 2 years ago)
- Last Synced: 2023-03-05T09:23:55.068Z (almost 2 years ago)
- Topics: api, axios, expressjs, fullstack-javascript, javascript, mongodb, mongoose, nodejs
- Language: JavaScript
- Homepage: https://pocketifyurl.herokuapp.com/
- Size: 291 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pocket URL
> A full stack Javascript URL shortening app using API first approach.
> API made using Node.js (Express) and MongoDB (mongoose) and frontend using axios## Usage
Rename config/config.env.env to config/config.env and update the settings values of your own## Install Dependencies
```
npm install
```## Run App
```
# In development mode
npm run dev#In production mode
npm start
```
##End points
To shorten the URL
```
Request-Type: POST
ROUTE: http://yourdomain.com/
Headers: {
Content-Type:application/json
}
Body: {
"longUrl":"URL to shorten"
}
```
This gives you a url object with the short code```
{
"success": true,
"data": {
"_id": "5ee7352f97f6de10e9bee7e8",
"longUrl": "submitted long URL",
"shortUrl": "http://yourdomain.com/ANXD_u8Bf",
"code": "ANXD_u8Bf",
"createdAt": "1592210735285",
"__v": 0
}
}
```
As seen, send a GET request to "shortURl" to be redirected to the original page.***
## Features
* Paste the long URL that you want to shorten
* Get the short URL
* Use the short URL to access original page## FrontEnd
Front end for the API has been coded in ES6+ Javascript using axios for communicating with API#### Security Features
* NoSQL injection secure
* Security headers has been added
* Cross-site scripting(XSS) secure
* Cross-Origin Resource Sharing (CORS) enabled
* HTTP Param Pollution prevented***
## Demo
![alt tag](https://surojmaharjan0.github.io/projectimages/images/pocketurl.PNG)This app is live [here](https://pocketifyurl.herokuapp.com/)
* Version **1.0**
* Author **Suroj Maharjan**