This repository has been archived by the owner on Jan 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Does not change 404s for routes which are APIs, i.e., not seen by humans.
- Loading branch information
Showing
5 changed files
with
77 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
exports.createModel = function (req) { | ||
return { | ||
title: "Page Not Found" | ||
}; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const { Page } = require("../../reactruntime"); | ||
const viewModule = require("./view"); | ||
|
||
exports.page = new Page({ | ||
dir: __dirname, | ||
viewModule, | ||
noBrowserJavascript: true | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const reactrender = require("../../reactrender"); | ||
|
||
exports.notFound = function (req, res) { | ||
const page = require("./page").page; | ||
res.status(404); | ||
reactrender.render(req, res, page); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* globals location*/ | ||
const reactruntime = require("../../reactruntime"); | ||
const { Footer } = require("../../footer-view.js"); | ||
const React = require("react"); | ||
|
||
class Head extends React.Component { | ||
render() { | ||
return ( | ||
<reactruntime.HeadTemplate {...this.props}> | ||
<link rel="stylesheet" href={this.props.staticLink("css/simple.css")} /> | ||
</reactruntime.HeadTemplate> | ||
); | ||
} | ||
} | ||
|
||
class Body extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = {defaultSearch: props.defaultSearch}; | ||
} | ||
|
||
render() { | ||
return ( | ||
<reactruntime.BodyTemplate {...this.props}> | ||
<div className="column-space full-height default-color-scheme"> | ||
<div className="header"> | ||
<h1><a href="/shots">Page Shot</a></h1> | ||
</div> | ||
<div className="responsive-wrapper flex-1"> | ||
<h2>{this.props.title}</h2> | ||
<p> | ||
The page was not found. | ||
</p> | ||
</div> | ||
<Footer forUrl="legal" {...this.props} /> | ||
</div> | ||
</reactruntime.BodyTemplate> | ||
) | ||
} | ||
} | ||
|
||
exports.HeadFactory = React.createFactory(Head); | ||
exports.BodyFactory = React.createFactory(Body); |
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