Answer the question
In order to leave comments, you need to log in
How to correctly set paths in Node?
When I go to the home page and the user page everything works, but when I try to go to another directory - an error. ATP in advance
// frontpage directory
app.get('/', require('./frontpage').get);
// another directories
app.get('/edit', require('./edit').get);
app.post('/edit', require('./edit').post);
app.get('/messages', require('./message').get);
// registration
app.get('/registration', require('./registration').get);
app.post('/registration', require('./registration').post);
app.post('/registration/name', require('./registration').postName);
app.post('/registration/avatar', upload.any(), require('./registration').postAvatar);
app.post('/registration/about', require('./registration').postAbout);
app.post('/registration/info', require('./registration').postInfo);
app.post('/registration/secret', require('./registration').postSecret);
// authorization
app.get('/login', require('./login').get);
app.post('/login', require('./login').post);
app.get('/logout', require('./logout').get);
// users
app.get('/users', require('./users').get);
// user
app.get('/:id', require('./frontpage').user);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question