A Node.js private URL shortener.
- Add a user:
./user.js --help
- Start nodejshort:
npm start
- Browse to localhost:3000
Currently the only way to shorten a link is to do a POST request against /create with the following parameters:
username
: Your usernamepassword
: Your passwordurl
: The URL that you want to shorten
Output:
- Status code 403: Invalid username/password
- Status code 400: Invalid URL
- Status code 500: An error occurred while creating the URL
- Status code 201: URL created
- Also outputs a JSON object with the alias. Example:
{ alias: "obier" }
- Also outputs a JSON object with the alias. Example: