@markout-lang/express
v0.8.4
Published
Markout as Express middleware: render markout pages from an application that already has a server
Maintainers
Readme
@markout-lang/express
Markout as Express middleware: your application's own routes first, then markout, then static files.
import express from 'express';
import { markout } from '@markout-lang/express';
const app = express();
app.get('/api/things', myHandler); // yours, and it wins
app.use(markout({ docroot: './site' })); // pages, compiled and rendered
app.use(express.static('./site')); // everything elseThat order is the point: markout is the presentation layer and does not want
your routes. A page is an ordinary .html file, rendered server-side with
the same scope-and-value model that then runs in the browser, so there is no
flash and no second fetch.
dev: true adds live reload and readable expressions; leave it off in
production.
Full documentation is in the repository.
MIT.
