Skip to content
Snippets Groups Projects
Commit 91a10719 authored by Leander Tolksdorf's avatar Leander Tolksdorf
Browse files

Forgot some files in my last commit

parent 125bb28a
No related branches found
No related tags found
No related merge requests found
# Fahrtenbuch
- First create .env File from .env.example
## How to develop
- Install modules:
```
npm install
```
- Install modules for client and server: `cd client && npm i && cd ../server && npm i`
- Create .env file from .env.example in server: `cp ./server/.env.example ./server/.env`
- Build client: `cd client && npm run build`
- Start development backend server: `cd server && npm run dev`
- Run
```
npm run dev
```
This method supports hot-reload for the server but not for the client because the server serves the production build of React.
To develop with hot-reload on both client and server, do this:
```
npm run start
```
- Start development backend server on port 4000: `cd server && npm run dev`
- In a second terminal, start development client server on port 3000: `cd client && npm start`
- Open the client on `localhost:3000`. API requests from the client now get proxied to the backend dev server as specified in the client's package.json under "proxy".
......@@ -48,5 +48,6 @@
"last 1 firefox version",
"last 1 safari version"
]
}
},
"proxy": "http://localhost:4000"
}
......@@ -6,7 +6,7 @@
"scripts": {
"dev": "nodemon",
"build": "tsc",
"start": "node .",
"start": "node ./dist/server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
......
......@@ -21,7 +21,7 @@ let init = async () => {
}
);
});
const port = process.env.PORT || 3000;
const port = process.env.PORT || 4000;
app.listen(port, () => console.log(`Server listening on port: ${port}`));
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment