-
The official Haxe sources:
- https://haxe.org/manual/macro.html
- http://api.haxe.org/haxe/macro/
- http://code.haxe.org/category/macros/
Getting better all the time, this is the definitive guide though quite meaty and requires a good couple of passes before things make sense. Learn from simple examples and practicing, use the manual as a reference.
-
Macronauts: Macro workshop
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');
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
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 |