Skip to content

Instantly share code, notes, and snippets.

View streamich's full-sized avatar
🕶️
married

Va Da streamich

🕶️
married
  • Switzerland
  • 21:01 (UTC +02:00)
View GitHub Profile
const enum CONST {
MAX_LENGTH = 128,
}
class BigArrayRef<T> {
constructor (public readonly arr: BigArray<T>, public readonly pos: number) {}
}
export class BigArray<T> {
public length = 0;

Requirements

  • Ability to match static routes GET /foo/bar
    • ['GET /foo/bar']
  • Ability to match a single step in a route POST /users/{userId}/edit or POST /users/{userId:*/}edit
    • ['POST /users/', match('userId', '*/'), '/edit']
  • Ability to wildcard the ending of a route GET /static/{filename:*}
    • ['GET /static/', match('filename', '*')]
  • Ability to make the last route step optional GET /users{userId?:/*/}
  • ['GET /users'] and

146aPdVmwzwzwzWe:)P

14Pd:)P2022

@streamich
streamich / lambda.js
Last active April 29, 2024 19:45 — forked from maxbeatty/lambda.js
using node-postgres (`pg`) in AWS Lambda
import λ from "apex.js";
import { Pool } from "pg";
// connection details inherited from environment
const pool = new Pool({
max: 1,
min: 0,
idleTimeoutMillis: 120000,
connectionTimeoutMillis: 10000
});