Sign inSign up

nlmedina/node-url-shortener

By nlmedina

•Updated over 6 years ago

Example URL shortening app built using Node.js and Express. Uses the bit.ly bitlinks API.

Image
0

892

nlmedina/node-url-shortener repository overview

⁠Node.js URL Shortener

Build Status

⁠Getting started

⁠Local

git clone [email protected]:nlmedina/node-url-shortener.git
cd node-url-shortener
cp .env.sample .env
npm install
npm start

⁠Docker

docker pull nlmedina/node-url-shortener:latest
docker run -d -p <host port>:3000 -e BITLY_ACCESS_TOKEN=<bit.ly access token> nlmedina/node-url-shortener:latest

⁠Requirements

  • Node.js >= 10 (Dubnium LTS)
  • bit.ly⁠ access token

⁠Configuration

⁠Environment Variables

  • NODE_ENV - tells the runtime what type of environment the apps runs on (production, development)
  • PORT - the port which the app runs on (default: 3000)
  • OUTPUT_FILE - this app logs shortened URLs to a text file. By default, the file is /tmp/results.txt
  • BITLY_ACCESS_TOKEN - (required) the token the app will use to connect to bit.ly⁠ (API docs⁠)

Tag summary

Content type

Image

Digest

Size

53.6 MB

Last updated

over 6 years ago

docker pull nlmedina/node-url-shortener