'Keystone Error 404 "No Page could by found at this address (404)"
I'm running my keystone Website on localhost and I'm trying to create a new navigation link with a new site but I get an Error that the address behind the Link cannot be found.
The link is displayed in the navigation bar.
I created a file in /routes/views/aboutme.js with following code:
var keystone = require('keystone');
exports = module.exports = function (req, res) {
var view = new keystone.View(req, res);
var locals = res.locals;
// locals.section is used to set the currently selected
// item in the header navigation.
locals.section = 'aboutme';
// Render the view
view.render('aboutme');
};
And a .jade in /templates/views/aboutme.jade file with the code:
extends ../layouts/default
block content
h1 xyz
p xyzxyzyxzxyzxyzyxzzxyz
p xyzxyzyxzxyzxyzyxzzxyz
p xyzxyzyxzxyzxyzyxzzxyz
Why the Page cannot be found? :/
Solution 1:[1]
I found the answer on my own. For everyone, who has the same problem, in the /routes folder there is the index.js file. In this code at the point:
// Setup Route Bindings
exports = module.exports = function (app) {
}
Between the curly braces you have to write the following code:
app.get('/name', routes.views.name);
"Name" is your new sitename.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | AbsolutStorm |
