【问题标题】:Upload react basic application to server将 React 基本应用程序上传到服务器
【发布时间】: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


    【解决方案1】:

    这更像是将node.js 部署到远程服务器。

    我建议你使用 heroku 按照these 的步骤轻松将您的应用部署到他们的服务器。

    【讨论】:

      猜你喜欢
      • 2019-07-12
      • 1970-01-01
      • 2011-01-14
      • 2020-11-05
      • 2017-03-02
      • 2021-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多