我使用 Node.js 的 Web 应用程序无法在我的本地主机上加载

my web aplication using Node.js doesnt load on my localhost

我的本地主机没有加载, 我不知道该怎么做,我已经安装了所有库,我已经重新启动了节点、我的电脑和所有东西;c

   const express = require('express')
    const handlebars = require('express-handlebars')
    const bodyParser = require('body-parser')
    const mongoose = require('mongoose')
    const app = express()
    
    
    //configurações das biblioteca
    //bodyparser
        app.use(bodyParser.urlencoded({extended: true}))
        app.use(bodyParser.json)
    // handlebars
    
        app.engine('handlebars', handlebars({defaultLayout: 'main'}))
        app.set('view engine', handlebars)
    // mongoose
    
        mongoose.Promise = global.Promise;
        mongoose.connect("mongodb://localhost/nomedobanco").then(() => {
            console.log("conectado com sucesso")
        }).catch((err) => {
            console.log("deu um erro"+err)})
    
    //pasta de arquivos estáticos (como bootsrap)
       //rotas
       app.get('/', (req, res) => {
           res.render('oi')
       })
       app.listen(8080)

[本地主机未加载[1] [1]: https://i.stack.imgur.com/yat60.png

你应该从

换行
app.use(bodyParser.json)

app.use(bodyParser.json())

您还应该修复车把的设置方式

const hbs = handlebars.create({defaultLayout: 'main'});
app.engine('handlebars', hbs.engine)
app.set('view engine', 'handlebars')