Skip to content

Commit acb34bf

Browse files
committed
chore(): improvment README and apikeys on delete
1 parent 2f9add9 commit acb34bf

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[![](https://i.ibb.co/XC8sJYY/1.png)](https://i.ibb.co/XC8sJYY/1.png)
22

3-
#### **Simple self hosted, open source**, shorten link service written in Node(Typescript) using DynamoDB (build folder 36kb)
3+
#### **Tiny self hosted, open source**, shorten link service written in Node(Typescript) using DynamoDB.
44

55
## Features
66

7+
- [x] Tiny (build folder 42kb) ✅
78
- [x] DynamoDB with AWS SDK as database provider (no configuration) ✅
89
- [x] Create (same api for update) short URL ✅
910
- [x] Delete short URL ✅

src/auth/apiKeys.guard.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { env } from "process";
22
import { Request, Response, NextFunction } from "express";
33

4-
export const apiKeyGuard = (req: Request, res: Response, next: NextFunction) => {
4+
export const apiKeyGuard = (
5+
req: Request,
6+
res: Response,
7+
next: NextFunction
8+
): any => {
59
if (!env.API_KEYS) {
610
console.warn("No API Keys found in env, all requests will be allowed");
711
next();

src/controllers/links.controller.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export default class LinksController {
4141

4242
app.delete(
4343
"/api/links/:_slug",
44+
apiGuard,
4445
[param("_slug").isString().exists().trim()],
4546
async (req: Request, res: Response) => {
4647
const errors = validationResult(req);

0 commit comments

Comments
 (0)