我在https://expressjs.com/en/starter/hello-world.html提供的app.js中写了以下代码
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
})
我将它放在 /nodejsapp 文件夹中,并按照一些教程的建议添加了 .htaccess。
i was expecting to get "Hello World!" but instead got "Cannot GET /index.html"
https://i.stack.imgur.com/tHQ28.png
[](https://i.stack.imgur.com/tHQ28.png)
I am not providing any route to index.html so why is it saying so
my application manager
https://i.stack.imgur.com/2F0xx.png
[](https://i.stack.imgur.com/2F0xx.png)