Compare commits

..

No commits in common. "1c4fd23e7613b3950d547a702bbc048f80013dee" and "b0027575b6cb9aa86d20411cacdd23a775c9fc61" have entirely different histories.

2 changed files with 4 additions and 24 deletions

View File

@ -1,22 +1,4 @@
# Forum Frontend
The frontend for the forum is written in React.
Should be extremely simple to start with no styling.
**Note**: Before running, update the `apiUrl` in `app/src/App.js` to point your backend.
## Development
To start the frontend in development mode and serve on http://localhost:3000:
```shell
npm run start
```
## Production
```shell
# Install serve
npm install -g serve
# Build for production
npm run build
# Serve
serve -s --no-clipboard build
```
Node.js with a nice framework should be the ultimate goal, but could just do simple HTML and JS by hand for now.

View File

@ -3,13 +3,11 @@ import {useEffect, useState} from "react";
import axios from "axios";
import PostList from "./components/Post/PostList";
const apiUrl = "http://localhost:8000";
function App() {
const [postList, setPostsList] = useState([]);
const fetchPosts = async () => {
await axios.get(apiUrl + "/catalog")
await axios.get("http://localhost:8000/catalog")
.then((response) => { setPostsList(response.data)})
}