Skip to content

Commit 787d00c

Browse files
committed
Implement usernameExtract for extracting username
1 parent 83d97e4 commit 787d00c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

script.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
import express from "express"
2+
const app = express();
3+
const port = 3000;
4+
5+
function usernameExtract(req, res, next) {
6+
const username = req.get("X-Username");
7+
req.username = username ? username : null;
8+
next();
9+
}
10+

0 commit comments

Comments
 (0)