Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zaida04/rent-a-ni.co
🔗🚀 Personal link shortening service built with fastify.
https://github.com/zaida04/rent-a-ni.co
docker link-shortener link-shortener-api typescript
Last synced: 20 days ago
JSON representation
🔗🚀 Personal link shortening service built with fastify.
- Host: GitHub
- URL: https://github.com/zaida04/rent-a-ni.co
- Owner: zaida04
- License: mit
- Created: 2021-05-11T17:41:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-19T23:24:04.000Z (almost 3 years ago)
- Last Synced: 2024-10-10T23:35:12.809Z (about 1 month ago)
- Topics: docker, link-shortener, link-shortener-api, typescript
- Language: TypeScript
- Homepage: https://rent-a-ni.co/
- Size: 142 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 📝 About
Personal link shortening service built with fastify## 📦 Main Dependencies
- [Fastify](https://www.fastify.io/docs/latest/TypeScript/) - HTTP Router
- [BCrypt](https://www.npmjs.com/package/bcrypt) - Hashing and dehashing of password
- [JWT](https://www.npmjs.com/package/jsonwebtoken) - Encrypted payload that holds data
- [Knex](http://knexjs.org/) - Database query builder
- [NanoID](https://github.com/ai/nanoid) - URL-safe ID generator
- [UUID](https://www.npmjs.com/package/uuid) - Unique ID generator## API Routes
API Routes suffixed with 🔒 require authentication. You authenticate yourself by passing an `Authorization: Bearer ` header with your request. You can retrieve a token by [creating an account](https://github.com/zaida04/rent-a-ni.co#post-apiv1accounts) or [logging into an account](https://github.com/zaida04/rent-a-ni.co#post-apiv1accountslogin)### `GET /api/v1/`
General message about the API### `POST /api/v1/redirects` 🔒
Create a short link.
```ts
Request Body
{
destination: string
}
```
```ts
Status 200
{
nanoId: string,
id: string
}
```### `DELETE /api/v1/redirects/s/:id` 🔒
Delete a short link```ts
Status 200
{
id: string,
shorthand_id: string
}
```### `POST /api/v1/accounts/`
Create an account.```ts
Request Body
{
email: string,
username: string,
password: string
}
```
```ts
Status 200
{
token: string
}
```### `POST /api/v1/accounts/login`
Login to an account and retrieve the generated token.```ts
Request Body
{
username: string,
password: string
}
```
```ts
Status 200
{
token: string
}
```
```ts
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](https://github.com/zaida04/rent-a-ni.co/blob/main/LICENSE)For routes that require authentication, please pass a header like so: `Authorization: Bearer `