我正在使用中微子作为webpack 3.1的脚手架工具,我正在寻找一个合适的中微子预设,将Express和WebPack结合在一起,以便我看到一个" Hello World"网站。如果有人给我一个适当的预设并告诉我如何安装它,我将接受它作为答案。
谢谢!
@netrinojs/node预设应该已经可以了:
// src/index.js
import express from 'express';
import { join } from 'path';
const port = process.env.PORT || 3000;
const app = express();
app.get('/', (request, response) => {
response.sendFile(join(__dirname, 'index.html'));
});
app.listen(port, () => console.log(`Server running on port ${port}`));