Noded/frontend#84 - make welcome page redirect to SPA by default
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details

master
Garrett Mills 3 years ago
parent 33944c1b86
commit bebdd504dd
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

@ -15,17 +15,7 @@ class Home extends Controller {
* Serve the main welcome page.
*/
welcome(req, res) {
if (req.user) {
// If we have a user, redirect them to the main app
return res.redirect('/i')
}
/*
* Return the welcome view.
* The page() method is added by Flitter and passes some
* helpful contextual data to the view as well.
*/
return res.page('welcome', { user: req.user });
return res.redirect('/i')
}
async get_login(req, res) {

@ -167,6 +167,11 @@ class Page extends Controller {
return res.api(return_nodes)
}
async get_node(req, res) {
let { page, node } = req.form
return res.api(node)
}
async save_node_to_page(req, res) {
const { page } = req.form

@ -24,6 +24,13 @@ module.exports = exports = {
['middleware::api:DataInjection', { access_level: 'view' }],
'controller::api:v1:Page.get_nodes',
],
// Get a particular node present on the specified page
'/:PageId/nodes/:NodeId': [
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'view' }],
'controller::api:v1:Page.get_node',
],
},
post: {

Loading…
Cancel
Save