无法使用Express运行NodeJS服务器

这些文件位于我的虚拟主机上。

NodeJS非常令人困惑,不像PHP那样简单。这是我第一次使用它。您能否再耐心一点,不要拒绝投票或结束这个问题?

I installed the express module in the root directory by running the following command:

npm install express --save

这是我的目录结构:

root
   custom_folder
   node_modules
   app.js

I just copy pasted the following code into my app.js file from the Hello World tutorial here: http://expressjs.com/en/starter/hello-world.html.

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 at http://server.ip:${port}`))

更新:

I also ran the command node app.js in the terminal.

However, when I go to http://my-domain.com:3000/, it just says server timed out.

这是为什么?

谢谢。