【发布时间】:2016-10-31 02:02:52
【问题描述】:
我正在尝试将以下内容上传到我的个人服务器以查看其工作原理:
https://github.com/remarkablemark/universal-react-tutorial
我已尝试在此处更改端口:(server.js)
require('babel-register')({
presets: ['react']
});
var express = require('express');
var app = express();
app.use(express.static('public'));
app.use(require('./routes/index.jsx'));
var PORT = 80;
app.listen(PORT, function() {
console.log('http://localhost:' + PORT);
});
但是当我输入相应的网址时,我得到了这个:
**
Index of /ReactServer
Parent Directory
Component.jsx
client.js
public/
routes/
server.js
webpack.config.js
Apache Server at www.alessandrosantese.com Port 80
**
我可以在 http://localhost:3000/ 看到该应用运行良好,但我想在服务器上对其进行测试(我从未在实时服务器上部署过 React 应用)
【问题讨论】:
标签: node.js reactjs serverside-javascript