A simple front-end web application for boardfarm.
- Install node for your machine https://nodejs.org/en/download/
# Ubuntu 18 sudo apt update sudo apt install nodejs npm
- Clone this project
git clone [email protected]:mbanders/boardfarm_server_vue.git
- Install needed libraries
cd boardfarm_server_vue/ npm install
- Let this app know where the backend is served from. Edit the file
src/store/store.js
:loadStations ({ commit }) { axios .get('http://boardfarm.bluejam.net/api/stations')
- Start server
npm run serve
- Visit http://localhost:8080/ to see your website.
This frontend web app is only static files, so it could be served by any webserver software you wish. Here we use Apache:
- Install needed libraries
sudo apt update sudo apt install apache2 nodejs npm
- Install needed apache mods (this will allow serving both frontend and backend using a proxy)
sudo a2enmod proxy sudo a2enmod proxy_http sudo a2enmod proxy_balancer sudo a2enmod lbmethod_byrequests
- Clone this project & build static files to be served
The above creates a
git clone [email protected]:mbanders/boardfarm_server_vue.git cd boardfarm_server_vue/ npm install npm run build
dist/
directory containing anindex.html
and other files. - Modify your apache site configuration file, default is
/etc/apache2/sites-enabled/000-default.conf
. The full path to thedist/
directory from above step is needed in two spots. And then add the two proxy lines are so that you can serve the boardfarm server backend being served by node:<VirtualHost *:80> <Directory /path/to/boardfarm_server_vue/dist> Options FollowSymLinks AllowOverride None Require all granted </Directory> ... DocumentRoot /path/to/boardfarm_server_vue/dist ... # Reverse proxy to the backend REST api. This is optional, and you # probably run the REST api on a different port anyway. ProxyPass /api http://localhost:5001/api </VirtualHost>
- Restart apache
sudo service apache2 restart
You should now be able to visit http://localhost/ to see this frontend project, and also http://localhost/api/ to see the backend.