fixed some incorrect routes
This commit is contained in:
@@ -71,7 +71,7 @@ router.post(`${config.site_path}/submit_post`, (req,res) => {
|
||||
fs.writeFileSync(`../data/posts.json`, `${JSON.stringify(posts)}`, 'utf-8');
|
||||
comments.push({'id': id, 'comments': []})
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`)
|
||||
res.redirect(302, `/post/${id}`);
|
||||
res.redirect(302, `${config.sitr_path}/post/${id}`);
|
||||
}
|
||||
else {
|
||||
res.render("partials/message", {
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ router.get(`${config.site_path}/${config.signup_url}`, (req,res) => {
|
||||
}
|
||||
// If allow_signup is undefined or not a boolean, error
|
||||
else {
|
||||
res.redirect(301,"/")
|
||||
res.redirect(301,config.site_path)
|
||||
console.log("Error, invalid value for allow_signup (bool)")
|
||||
}
|
||||
}); // /signup
|
||||
|
||||
@@ -89,7 +89,7 @@ router.get(`${config.site_path}/post/:post_index`, (req, res) => {
|
||||
}
|
||||
else {
|
||||
console.log("Error loading page")
|
||||
res.redirect(301,"/")
|
||||
res.redirect(301,config.site_path)
|
||||
}
|
||||
}); // /post/:post_index
|
||||
|
||||
|
||||
@@ -50,6 +50,9 @@ function perform_checks()
|
||||
exit_flag = false
|
||||
required_values = ['site_admin','seperator','site_name','site_url','locale','port','cache_data','allow_signup','site_description','request_data_limit','enable_hitcount','charset','root_path','edit_account_base_url','new_post_url','signup_url','default_commenter_username','rss','atom','date_format','time_zone','css']
|
||||
// Perform some standard checks:
|
||||
if config.site_path.slice(-1) == "/" { // cut off a trailing /
|
||||
config.site_path = config.site_path.substring(0,config.site_path.length-1);
|
||||
}
|
||||
|
||||
// data_storage
|
||||
switch (config.data_storage)
|
||||
|
||||
Reference in New Issue
Block a user