docs: updated README

* and small documentation changes
This commit is contained in:
Florent Chehab 2020-04-19 18:14:44 +02:00
parent d5cb969ee5
commit ffff0899cc
No known key found for this signature in database
GPG Key ID: 9A0CE018889EA246
4 changed files with 10 additions and 3 deletions

View File

@ -24,14 +24,18 @@ You can run this app with and without docker
### Without Docker ### Without Docker
1. install the latest NodeJs 1. install the latest NodeJs
2. Clone the app 2. Clone the app
3. Run `npm i` inside the folder 3. Run `npm ci` inside the folder
4. Run `node server.js` 4. Run `npm run start:prod`
5. Surf to http://YOURIP:8080 5. Surf to http://YOURIP:8080
### With Docker ### With Docker
1. `docker run -d -p 8080:8080 rofl256/whiteboard` 1. `docker run -d -p 8080:8080 rofl256/whiteboard`
2. Surf to http://YOURIP:8080 2. Surf to http://YOURIP:8080
## Development
After you have installed the app, run `npm run start:dev` to lunch the backend and a frontend development server. The website will be accessible on http://locahost:8080.
## Default keyboard shortcuts ## Default keyboard shortcuts
Use keyboard shortcuts to become more productive while using Whiteboard. Use keyboard shortcuts to become more productive while using Whiteboard.

View File

@ -11,7 +11,7 @@ const devConfig = merge(baseConfig, {
plugins: [ plugins: [
new webpack.HotModuleReplacementPlugin(), new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), new webpack.NamedModulesPlugin(),
new webpack.NoEmitOnErrorsPlugin(), // don't reload if there is an error new webpack.NoEmitOnErrorsPlugin(),
].concat(baseConfig.plugins), ].concat(baseConfig.plugins),
}); });

View File

@ -6,6 +6,7 @@ const devServerConfig = {
maxModules: 0 maxModules: 0
}, },
proxy: { proxy: {
// proxies for the backend
'/api': 'http://localhost:3000', '/api': 'http://localhost:3000',
'/uploads': 'http://localhost:3000', '/uploads': 'http://localhost:3000',
'/ws-api': { '/ws-api': {

View File

@ -18,6 +18,8 @@ const server_mode = args.mode === "production" ? SERVER_MODES.PRODUCTION : SERVE
if (server_mode === SERVER_MODES.DEVELOPMENT){ if (server_mode === SERVER_MODES.DEVELOPMENT){
console.info("Starting server in development mode."); console.info("Starting server in development mode.");
startFrontendDevServer(8080); startFrontendDevServer(8080);
// this time, it's the frontend server that is on port 8080
// requests for the backend will be proxied to prevent cross origins errors
startBackendServer(3000); startBackendServer(3000);
} else { } else {
console.info("Starting server in production mode."); console.info("Starting server in production mode.");