Skip to content

Instantly share code, notes, and snippets.

View sallamTanna's full-sized avatar
🚀
NEVER HALT

SallamTanna sallamTanna

🚀
NEVER HALT
View GitHub Profile
@Geoff-Ford
Geoff-Ford / master-javascript-interview.md
Last active November 21, 2025 01:12
Eric Elliott's Master the JavaScript Interview Series
@joshnuss
joshnuss / app.js
Last active November 4, 2025 22:39
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection