This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 "./permission"; // middleware for checking if user's role is permitted to make request | |
const app = express(), | |
api = express.Router(); | |
// first middleware will setup db connection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🌞 Morning 714 commits █████▌░░░░░░░░░░░░░░░ 26.5% | |
🌆 Daytime 1149 commits ████████▉░░░░░░░░░░░░ 42.6% | |
🌃 Evening 62 commits ▍░░░░░░░░░░░░░░░░░░░░ 2.3% | |
🌙 Night 772 commits ██████░░░░░░░░░░░░░░░ 28.6% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Builder<T> { | |
static ctor = undefined; | |
static propertyNames: Array<string> = undefined; | |
protected properties = {}; | |
build(): T { | |
const builderDef = Object.getPrototypeOf(this).constructor; | |
const instance = new builderDef.ctor(); | |
for (const prop of builderDef.propertyNames) { |