At first clone the repository:
$ git clone [email protected]:m4mController/frontend.git && cd frontend
SERVER
. Ignored withnpm run build
! Default:backend
. Possible values:backend
: frontend will be targeted to the real backend (meter4.me).proxy
: local proxy server to the backend will be started. Good for local deploying.mock
: local mock server will be started. Good for deploying without internet access.
MODE
. Default:default
. Possible values:default
: frontend for meter4.me will be build.lite
: frontend for controller will be build.
BACKEND_API
. Backend
Now you can build and run the app, there are several ways to do it:
- Build the docker image:
$ docker build -t m4m-frontend .
- Run a container (replace
<PORT>
with port you want to listen):
$ docker run -p <PORT>:80 m4m-frontend
Open http://localhost:<PORT>
in the browser.
-
It requires Node.js with npm. Install them.
-
Install dependencies:
$ npm install
- Run the server (replace
<PORT>
with port you want to listen):
$ PORT=<PORT> npm start
And open http://localhost:<PORT>
in the browser.
-
It requires Node.js with npm. Install them.
-
Install dependencies:
$ npm install
- Generate bundle:
$ npm run build
Generated files are located in dist/
directory. For it to work
properly, you should use them and public/
as static files on your
server. Do it manually, or do the following to run with nginx:
-
Install nginx.
-
Copy generated files:
cp -R dist/. /usr/html/
- Copy static files:
cp -R public/. /usr/html/
- Copy nginx config:
cp nginx.conf /etc/nginx/nginx.conf
- Restart nginx:
sudo service nginx restart
Open http://localhost
in the browser