Skip to content

Commit

Permalink
update react-player-list-tryout
Browse files Browse the repository at this point in the history
  • Loading branch information
louiscklaw committed May 7, 2023
1 parent 44a8350 commit 352942c
Show file tree
Hide file tree
Showing 8 changed files with 2,808 additions and 4,094 deletions.
45 changes: 11 additions & 34 deletions react-player-helloworld/react-player-list-tryout/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,18 @@
### development environment

start development environment

## React Boilerplate
```bash
# start react auto-refreshing
$ npm run react-dev

The following repo contains a very basic setup

```console
git clone https://github.com/asieke/React-Express-Boilerplate.git
cd React-Express-Boilerplate
npm install
```

### Running the server
# start express server
$ npm run start

Kick off webpack so that its running. Its set to use the -w option so it'll continuously compile the `client/src` directory into `client/dist`
# a switch to the browser is required, start with following shell-script
$ ./start_browser.sh

```console
npm run react-dev
# browse video player -> http://localhost:3000/
# browse testing page -> http://localhost:3000/test
```

### Start the Server

Nodemon should be installed - so all changes to the server will be automatically reloaded. You should be up and running at localhost:3000

```console
npm start
```

### The Express Server

It doesn't really do much other than serve the static files in client/dist

### Client

In the `client/dist` directory, you'll find the compiled `bundle.js` which is imported by `index.html`.

In the `src/ directory` we have the bare bones of a basic react app that has an `index.jsx` file and an App component that prints `Hello World`

### Webpack Config

Uses babel to precompile and currently is only set up for .jsx files
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@


## React Boilerplate

The following repo contains a very basic setup

```console
git clone https://github.com/asieke/React-Express-Boilerplate.git
cd React-Express-Boilerplate
npm install
```

### Running the server

Kick off webpack so that its running. Its set to use the -w option so it'll continuously compile the `client/src` directory into `client/dist`

```console
npm run react-dev
```

### Start the Server

Nodemon should be installed - so all changes to the server will be automatically reloaded. You should be up and running at localhost:3000

```console
npm start
```

### The Express Server

It doesn't really do much other than serve the static files in client/dist

### Client

In the `client/dist` directory, you'll find the compiled `bundle.js` which is imported by `index.html`.

In the `src/ directory` we have the bare bones of a basic react app that has an `index.jsx` file and an App component that prints `Hello World`

### Webpack Config

Uses babel to precompile and currently is only set up for .jsx files
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const Test = () => {
return <>Test</>;
};
export default Test;
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
import React, { Component } from 'react';
import ReactDOM from 'react-dom';

import { Router, Route, Switch } from 'react-router';
import { createBrowserHistory } from 'history';
const history = createBrowserHistory();

import App from './components/App.jsx';

let Home = () => {
return <div> hello Home </div>;
};
let About = () => {
return <div> hello About </div>;
};
let User = () => {
return <div> hello User </div>;
};
let NoMatch = () => {
return <div> hello NoMatch </div>;
};

let routes = (
<Switch>
<Route exact path="/">
<Home />
</Route>
<Route path="**/about">
<About />
</Route>
<Route path="/:user">
<User />
</Route>
<Route>
<NoMatch />
</Route>
</Switch>
);

ReactDOM.render(
<App />,
document.getElementById('root')
<>
<Router history={history}>
<App />
{routes}
</Router>
</>,
document.getElementById('root'),
);
Loading

0 comments on commit 352942c

Please sign in to comment.