Skip to content

Instantly share code, notes, and snippets.

View mikicho's full-sized avatar

Michael Solomon mikicho

View GitHub Profile
@kevinresol
kevinresol / Wiper.hx
Created January 20, 2018 02:37
Client side API Wiper for tink_web
package api;
// to use: add `implements api.Wiper` to your API class
// but it doesn't handle imports, either you use wildcard (import api.*) or guard them with `#if`
#if macro
import haxe.macro.Context;
using tink.MacroApi;
#end
@zcaceres
zcaceres / Nested-Routers-Express.md
Last active July 13, 2024 18:08
Child Routers in Express

Nested Routers in Express.js

Express makes it easy to nest routes in your routers. But I always had trouble accessing the request object's .params when you had a long URI with multiple parameters and nested routes.

Let's say you're building routes for a website www.music.com. Music is organized into albums with multiple tracks. Users can click to see a track list. Then they can select a single track and see a sub-page about that specific track.

At our application level, we could first have a Router to handle any requests to our albums.

const express = require('express');