I’ve tried everything possible but it keeps showing not found whenever I try the /json
in my web view. I even added a cors but it still isn’t working
import express from 'express';
import cors from 'cors';
const app = express();
app.use(cors());
app.get('/json', (req, res) => {
return res.status(200).json({"message": "Hello json"});
});
Your project link(s)
solution: boilerplate-npm - Replit
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.2088.76
Challenge Information:
Basic Node and Express - Serve JSON on a Specific Route