Skip to content

Instantly share code, notes, and snippets.

@james2doyle
james2doyle / fa-icons.json
Last active March 20, 2019 08:43
A big list (JSON object) of the font awesome icons as of 4.5.0
{
"fa-500px": "500px",
"fa-adjust": "Adjust",
"fa-adn": "Adn",
"fa-align-center": "Align Center",
"fa-align-justify": "Align Justify",
"fa-align-left": "Align Left",
"fa-align-right": "Align Right",
"fa-amazon": "Amazon",
"fa-ambulance": "Ambulance",
@joshnuss
joshnuss / app.js
Last active March 4, 2024 00:01
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