Я хочу загрузить страницу «получить все», когда я нахожусь на главной странице. Код ниже:
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => { console.log(`express server is listening on port ${PORT}`) });
app.get('/', (req: any, res: any) => {
res.redirect('/get-all');
});
app.post('/create', (req: any, res: any) => {
});
app.post('/get-all', (req: any, res: any) => {
res.send('get all') // error: get all not found
});
app.post('/delete', (req: any, res: any) => {
});
app.post('/update', (req: any, res: any) => {
});
Ошибка: не удается GET / get-all (я пытался запустить через Postman). Я не нашел четкого ответа в документации. Спасибо!