Step 3 Build and run application¶
For all further commands, run command prompt as Administrator.
Go to the application folder cd c:\workspace\framework``and set the environment variable ``NODE_PATH
equal to the path to the application. For Windows: command set NODE_PATH=c:\workspace\framework
, for Linux: export NODE_PATH=/workspace/framework
.
Build application¶
Building the application provides installing all the libraries, importing the data into the database, and preparing the application to run.
At the first launch, you need to run
npm install
command to install key dependencies, including thegulp
task runner locally. Make sure that theGulp
version is4.0
. This command will install all the libraries from the ``dependencies``property of ``package.json``file of the core.After that, and in all the next times, run the command
gulp assemble
to build the application.NB: Make sure that the environment variable
NODE_PATH
is set, theMongoDB
database is running, theGulp
is globally and locally installed and its version is``4.0``.Before launching the application, add a basic user for logging in. Open``Mongo Compass`` app and find the
ion-user``table in the database. Delete all the records you see there. Then go back to the console and execute the commands below. Add ``admin
user with123
password using commandnode bin/adduser.js --name admin --pwd 123
. Add administrator rights to the user using commandnode bin/acl.js --u admin@local --role admin --p full
.
Launch application using scripts¶
The bin
folder contains the scripts to run applications based on the IONDV.Framework, such as:
- acl.js
- export.js
- import.js and import-data.js
- setup.js
- www.js
NB. Run locally from the framework folder, command templates are listed in the sections describing the purpose of the script.
More details about application launch scripts
Run application¶
After finishing the build you can launch the app. Make sure that the environment variable NODE_PATH
is set. If skipping this step, the system will show the missing components error.
The system is launched by the command npm start
, alternative launch is node bin/www
.
After launching the system, open the browser with http://localhost:8888``adress and log in to the application, where ``8888
is a port specified in the server.ports
parameter in the launch configuration.