View online at: http://rnshpilot.fiviumdev.com/.
Pilot clinical research database for Royal North Shore Hospital, Sydney.
- Clone this repo.
- Ensure you have node.js installed.
- From within the cloned repository run
npm install - To start the dev server run
npm start - Point your browser to
http://localhost:3000.
NOTE: The front end executes in isolation and requires the backend details to be updated in /.env file before you start the server.
- If you plan to use the Go backend, add the following url to the .env file BACKEND_API_URL=http://localhost:3001/
- If you plan to use the Java backend, change the above url to BACKEND_API_URL=http://localhost:3001/rnsh-pilot-server-java
If you have issues getting things to run on widows, specifically errors relating to libsass, try the following:
npm install config-chainnpm rebuild node-sass
- Change
NODE_ENVin .env toproduction - Change
BACKEND_API_URLin .env to the URL of the backend API end point (e.g. http://api.rnshpilot.fiviumdev.com). - Bump version in
package.json - Tag build.
- Run
npm run clean - Run
npm run compile - If using apache:
- Remove all files in your apache html directory (/var/www/html)
- Deploy all files in
./distto your apache html directory.
- If using nginx:
- Remove all files in your server root (/var/www/rnshpilot.fiviumdev.com)
- Deploy all files in
./distto your server root directory.
Note: all occurrences of rnshpilot.fiviumdev.com below should be replace with the actual domain you are using
- Install nginx
sudo apt-get install nginx - Create a directory to store the webpage assets (/var/www/rnshpilot.fiviumdev.com)
- Create a config by copying the default one
cp /etc/nginx/site-available/default /etc/nginx/site-available/rnshpilot.fiviumdev.com - Modify the following in the contents of the newly created file.
server {
listen 80;
root /var/www/rnshpilot.fiviumdev.com;
index index.html index.htm;
server_name rnshpilot.fiviumdev.com;
location / {
# Ensure all URL requests are redirected to index.html
try_files $uri /index.html;
}
}
- Create a symlink to the new config
ln -s /etc/nginx/sites-available/rnshpilot.fiviumdev.com /etc/nginx/sites-enable/rnshpilot.fiviumdev.com - Restart nginx
service nginx restart