https://github.com/rajgoesout/petiteurl
A URL shortening service in Node.js
https://github.com/rajgoesout/petiteurl
express nodejs url-shortener
Last synced: 20 days ago
JSON representation
A URL shortening service in Node.js
- Host: GitHub
- URL: https://github.com/rajgoesout/petiteurl
- Owner: rajgoesout
- License: mit
- Created: 2019-02-21T15:15:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T13:27:08.000Z (over 2 years ago)
- Last Synced: 2025-05-04T21:18:14.972Z (20 days ago)
- Topics: express, nodejs, url-shortener
- Language: JavaScript
- Homepage: https://petiturl.herokuapp.com/
- Size: 1.27 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PetiteURL
A URL shortening service in Node.js
## Demo

## Getting Started
```
$ npm install
```Create a file `.env` and specify environment variable(s)
Start a MongoDB instance:
```
$ sudo mongod
```For example:
`DATABASE=mongodb://localhost:27017`Run in development environment:
```
$ npm run dev
```Run in production environment:
```
$ npm run start
```## Endpoints:
### Create new short_url
`POST /new`
Example request body:
```json
{
"url": "https://www.youtube.com/"
}
```Response:
```json
{
"original_url": "https://www.youtube.com/",
"short_id": "-f_vN1V"
}
```