start from subfolder

master
Tudor Stanciu 2020-05-01 04:06:48 +03:00
parent 357235a366
commit e01c3f5a23
3 changed files with 19 additions and 3 deletions

8
Notes
View File

@ -3,4 +3,10 @@ console.log(process.env.REACT_APP_TEST_KEY);
PUBLIC_URL=http://127.0.0.1/play-nine
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
https://medium.com/@svinkle/how-to-deploy-a-react-app-to-a-subdirectory-f694d46427c1
https://stackoverflow.com/questions/49429906/how-should-i-configure-create-react-app-to-serve-app-from-subdirectory
https://skryvets.com/blog/2018/09/20/an-elegant-solution-of-deploying-react-app-into-a-subdirectory/

View File

@ -1,12 +1,17 @@
import React from "react";
import Game from "./game";
import PageNotFound from "./PageNotFound";
import { Route, Switch } from "react-router-dom";
class App extends React.Component {
state = {};
render() {
return (
return (
<div>
<Game />
<Switch>
<Route exact path="/" component={Game} />
<Route component={PageNotFound} />
</Switch>
</div>
);
}

View File

@ -0,0 +1,5 @@
import React from "react";
const PageNotFound = () => <h1>Oops! Page not found</h1>;
export default PageNotFound;