Hello,
I am having CANNOT GET/ error message while ruining a MOCK API server opening my localhost on port 3000 via my browser using the following index.js file. Can you please tell me what i am doing wrong?
"use strict";
const express = require('express');
const bodyParser = require('body-parser');
const port = 3000;
const hostname = '127.0.0.1';
const app = express();
app.use(bodyParser.json());
const fixtures = require('./data/fixtures');
let fixturesDB = JSON.parse(JSON.stringify(fixtures));
app.listen(port, hostname, () => console.log("Server is listening on port 3000"));
I have tried to replace " const fixtures = require(’./data/fixtures’);" with //app.use(express.static(’./data/fixtures’)); but its still same error. can someone please help?
I use npm install and npm start run