sw2express
Version:
A lite & simple cross-platform Express-like web application framework
16 lines (15 loc) • 384 B
JavaScript
import sw2express, { plugins } from "../index.js";
const app = new sw2express();
app.extend(plugins.register);
app.register((app) => {
app.route("./bar").all(async (req, rep) => "Hello World");
}, "/foo/");
app.extend({
name: "say",
func: (app) => (text) => console.log(text, app),
bootstrap: (app) => {
app._say = true;
},
});
app.say("Hello world");
app.listen(8082);