https://github.com/hbjydev/linkd
A GraphQL URL shortener written in TypeScript
https://github.com/hbjydev/linkd
api koa links shortener typescript
Last synced: about 2 months ago
JSON representation
A GraphQL URL shortener written in TypeScript
- Host: GitHub
- URL: https://github.com/hbjydev/linkd
- Owner: hbjydev
- License: mit
- Created: 2020-06-30T22:22:13.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T22:28:21.000Z (over 3 years ago)
- Last Synced: 2025-02-11T14:21:59.943Z (over 1 year ago)
- Topics: api, koa, links, shortener, typescript
- Language: TypeScript
- Homepage:
- Size: 137 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# linkd
A small URL shortener written in TypeScript
## Documentation
#### `POST /url`
*Create a new shortlink*
Example body:
```json
{
"url": "https://google.com"
}
```
Example output:
```json
{
"message": "Short URL created.",
"data": {
"alias": "wda82",
"url": "https://google.com",
"accessKey": "pXA8N3Nlb9vFutS5"
},
"url": "https://linkd.pw/wda82
```
##### Input
```
| variable | example | description |
| ========= | ==================== | ============================================ |
| alias | `wda82` | The (optional) alias to create the link with |
| url | `https://google.com` | The URL to create a short URL for |
```
##### Output
- `message`: A short description of the action taken.
- `data`: See below.
- `url`: A Linkd URL with its alias set, ready to be shared.
```
| variable | example | description |
| ========= | ==================== | =================================================== |
| alias | `wda82` | The alias (or ID) to navigate to |
| url | `https://google.com` | The URL to the alias/ID will redirect to |
| accessKey | `pXA8N3Nlb9vFutS5` | The token you can use to modify the given short url |
```