Add goto function (#46)

* WIP

* programmatic navigation

* get tests working

* wait longer
This commit is contained in:
Rich Harris
2017-12-23 13:15:40 -05:00
committed by GitHub
parent e8d510b261
commit db1c1f332a
11 changed files with 1279 additions and 3764 deletions

View File

@@ -187,7 +187,8 @@ function get_route_handler(fn) {
next();
} catch(err) {
res.status(500).end(templates.render(500, {
res.status(500);
res.end(templates.render(500, {
title: (err && err.name) || 'Internal server error',
url,
error: escape_html(err && (err.details || err.message || err) || 'Unknown error'),
@@ -201,7 +202,8 @@ function get_not_found_handler(fn) {
return function handle_not_found(req, res) {
const asset_cache = fn();
res.status(404).end(templates.render(404, {
res.status(404);
res.end(templates.render(404, {
title: 'Not found',
status: 404,
method: req.method,