Code Monkey home page Code Monkey logo

rent-a-ni.co's Introduction

Kazuya

rent-a-ni.co

Link shortener named after the popular "RAG" series.

Lint and build License: MIT
Issues GitHub pull requests

๐Ÿ“ About

Personal link shortening service built with fastify

๐Ÿ“ฆ Main Dependencies

  • Fastify - HTTP Router
  • BCrypt - Hashing and dehashing of password
  • JWT - Encrypted payload that holds data
  • Knex - Database query builder
  • NanoID - URL-safe ID generator
  • UUID - Unique ID generator

API Routes

API Routes suffixed with ๐Ÿ”’ require authentication. You authenticate yourself by passing an Authorization: Bearer <token> header with your request. You can retrieve a token by creating an account or logging into an account

GET /api/v1/

General message about the API

POST /api/v1/redirects ๐Ÿ”’

Create a short link.

Request Body 
{
    destination: string
}
Status 200
{
    nanoId: string,
    id: string
}

DELETE /api/v1/redirects/s/:id ๐Ÿ”’

Delete a short link

Status 200
{
    id: string,
    shorthand_id: string
}

POST /api/v1/accounts/

Create an account.

Request Body
{
    email: string,
    username: string,
    password: string
}
Status 200
{
    token: string
}

POST /api/v1/accounts/login

Login to an account and retrieve the generated token.

Request Body
{
    username: string,
    password: string
}
Status 200
{
    token: string
}
Status 401
{
    message: string
}

GET /s/:id

Access a short link, will redirect user to the destination

GET /

Home page

โœ‹ Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

Please ensure any and all commits pass our tests, linting, and build steps

โš–๏ธ LICENSING

Licensed under the MIT License

For routes that require authentication, please pass a header like so: Authorization: Bearer <TOKEN>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.