mithril-route-render
v1.1.0
Published
render mithril.js route definitions on the server
Downloads
21
Readme
mithril-route-render
use mithril routes with express
installation
npm install mithril-route-render
usage
import routeRender from "mithril-route-render";
import * as browserMock from "mithril/test-utils/browserMock";
// use a mock DOM so we can run mithril on the server
browserMock(global);
import routes from "./your-mithril-routes";
routeRender(routes, "/route", "/default-route").then((partialHtml) => {
console.log(partialHtml);
});
see also
- mithril.js to get know what is mithril
- mithril-render to see what's behind the hood