最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

在 cpanel 中的 express.js 服务器上出现“无法获取 index.html”

网站源码admin25浏览0评论

在 cpanel 中的 express.js 服务器上出现“无法获取 /index.html”

在 cpanel 中的 express.js 服务器上出现“无法获取 /index.html”

我在.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" 
.png
[](.png)

I am not providing any route to index.html so why is it saying so

my application manager
.png
[](.png)
回答如下:
发布评论

评论列表(0)

  1. 暂无评论