A server to make a shortlinks to websites.
- Clone this repo
- Prepare a PostgreSQL database
- Open this project
- Run
npm i
- Create
.env
file in the root project with this format:
SVHOST=<An IP Address/hostname where you want to host>
SVPORT=<The Port where you bind the IP>
PGHOST=<Where PostgreSQL lives>
PGPORT=<Which port the PostgreSQL bound to>
PGUSER=<PostgreSQL Username>
PGPASSWORD=<PostgreSQL Password>
PGDATABASE=<PostgreSQL database>
- Run
npm run migrate up
- Run
npm run start
to start hosting.
server.js
- POST
/shortenLink
- POST
/customShortenLink
- GET
/expandLink