Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fetch('/api/someData', {
- method : "GET",
- })
- .then(......)
- app.get('/api/:blah', (req, res, next) => {
- if(logged in or authenticated user){
- next()
- } else {
- res.redirect('someReAuthPage')
- }
- })
- app.get('/api/someData', (req, res) => {
- ..........
- res.json('someJsonData')
- }
Add Comment
Please, Sign In to add comment