const https = require("http");
const app= require('./app');
const port = 8080;
const server = https.createServer(app);
server.listen(port)
答案 0 :(得分:2)
我不确定您要做什么,但是您可以通过以下方式使用express:
var express = require('express')
var app = express()
app.get('/', function (req, res) {
/// do something here
})
app.listen(8080)