I cant find my mistake after updating the node engine to 14.x and using ESM instead of CommonJS: exampleroute.js
import express from "express";
const router = express.Router();
router.get("/exampleroute", async (req, res) => {
console.log('......')
})
export default router;
server.js
import http from "http";
import express from "express";
import exampleroute from "./routes/exampleroute";
const server = express();
server.use("/exampleroute", exampleroute);
const httpServer = http.createServer(server);
const httpPort = 8080
httpServer.listen(httpPort, () => console.log(`server is running @ port: ${httpPort}`));
Leads to: Error [ERR_MODULE_NOT_FOUND]: Cannot find module
What am I doing wrong?