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 # 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. Node.js with a nice framework should be the ultimate goal, but could just do simple HTML and JS by hand for now.
## 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
```

View File

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