我有一个服务器,文件index.js的代码如下所示。我想贴在上面
https://dashboard.heroku.com/
. 但它不能启动命令
node inde.js
.
import http from 'http'
import express from 'express'
import bodyParser from 'body-parser';
const port = process.env.PORT || 8081;
const app = express();
const server = http.createServer(app);
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: false
}));
app.get('/', (req, res) => res.status(200).send({
message: 'Welcome',
}));
server.listen(port, () => {
console.log(`Server running at ${port}`);
});
如何使用ES6标准命令运行它
节点索引JS
?我已经安装了
babel7