change build script
This commit is contained in:
parent
20e59fa0d4
commit
e61dca1b60
@ -11,10 +11,11 @@
|
|||||||
"react-scripts": "3.4.1"
|
"react-scripts": "3.4.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start",
|
"start-app": "react-scripts start",
|
||||||
"build": "react-scripts build",
|
"build": "react-scripts build",
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject",
|
||||||
|
"start": "node server.js"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"extends": "react-app"
|
"extends": "react-app"
|
||||||
|
13
server.js
Normal file
13
server.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
const path = require('path');
|
||||||
|
const express = require('express');
|
||||||
|
const app = express();
|
||||||
|
const publicPath = path.join(__dirname, '.', 'build');
|
||||||
|
const port = process.env.PORT || 3000;
|
||||||
|
app.use(express.static(publicPath));
|
||||||
|
app.get('*', (req, res) => {
|
||||||
|
res.sendFile(path.join(publicPath, 'index.html'));
|
||||||
|
});
|
||||||
|
app.listen(port, () => {
|
||||||
|
console.log('Server is up!');
|
||||||
|
});
|
||||||
|
|
@ -3,6 +3,10 @@ import logo from './logo.svg';
|
|||||||
import './App.css';
|
import './App.css';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
return (
|
||||||
|
<h1>React My </h1>
|
||||||
|
|
||||||
|
)
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
<header className="App-header">
|
<header className="App-header">
|
||||||
|
Loading…
Reference in New Issue
Block a user