Skip to content

1. Setup the server

yopox edited this page Sep 4, 2019 · 2 revisions

The Dimensionneuse is a DIY template : it is meant to be hacked to suit your environment. In this page, you will find a configuration example for the server.

Installation

We used a Raspberry Pi to host the Dimensionneuse. Install Raspbian, then install git, node, and npm.

Clone the repository :

git clone https://github.com/WoMaParis/Dimensionneuse.git

Then install the dependencies :

npm install

Launch the server :

npm start

If everything went well, you should see the URL of the dimensionneuse in the console :

> node main.js
La Dimensionneuse is running !
->  On this computer : http://localhost:3000
->  Remote access : http://192.168.?.??:3000

Try loading the website in a browser at http://localhost:3000, or on another device connected to the same network at http://192.168.?.??:3000.

Static local IP

If you access the website with another device, it is useful to give a static local IP to the Raspberry. This can be setup easily in the internet box configuration. You can then bookmark the website on your device or use it as a progressive web app (select "Add to Home screen" on your browser).

Launch at startup

It is also handy to run node main.js when the Raspberry boots. Thus you only need to power on the Raspberry and the server will be live without any additional input. If you want to do so, follow this tutorial with the following service :

[Unit]
Description=Dimensionneuse Service
After=network.target

[Service]
WorkingDirectory=/path/to/dimensionneuse
ExecStart=/usr/bin/node main.js
Restart=on-failure
User=pi
Environment=PORT=3000

[Install]
WantedBy=multi-user.target
Clone this wiki locally