Install the Node Version Manager
By running curl https://raw.githubusercontent.com/creationix/nvm/v0.11.1/install.sh | bash
Install Node JS by running nvm install 10.16.0 and nvm use 10.16.0
Install the latest NPM by running npm install -g npm
Run npm install to install all prerequisites.
NOTE (for Mac): there's now a dependency on xcode application (xcode-select seems not to be enough)
#Current versions: nvm: 0.34.0 node: v10.16.0 npm: 6.10.1
-
Group Angular modules by functionality
-
A module for each feature
-
A module for each reusable component (especially directives and filters)
-
And an application level module which depends on the above modules and contains any initialization code.
-
Filenames start with uppercase for controllers, directives etc
-
Unit test filenames end in ...Spec
-
Directives are prefixed with poms, e.g. pomsGreeter equals poms-greeter (in file Greeter.js)
Checkout poms and follow the instruction to run it on your local machine. Then:
- Run backend server on port 8071
- Run
NPM_CONFIG_APIHOST=http://localhost:8071 && npm run watch:dev - Go to
http://localhost:8071/to trigger the login process via the backand server - Go to
http://localhost:portto debug the frontend application
Or a bit more fancy:
- Run backend server on port 8071
- Run frontend
./watch-proxy - Install ha-proxy
brew install haproxy - Run proxy
proxy/start.sh
Run ./watch-dev.sh to build and run the current development version on http://localhost:port ( port defaults to 4000 )
Run npm run watch:dev and navigate to http://localhost:port ( port defaults to 4000 )
Any changes to the code are automatically reflected in your browser.
If you want the server to run with different API and signon hosts you can override the package config settings by setting environment variables as follows:
NPM_CONFIG_APIHOST=http://poms-dev.omroep.nl NPM_CONFIG_SIGNONHOST=http://sso-dev.omroep.nl npm run watch:dev
The POMS gui can also run on https locally. To do so follow these steps
Use a secure API host when starting the server. For instance, NPM_CONFIG_APIHOST=https://poms-dev.omroep.nl
Specifiy the paths to your local server.key and server.crt files as the following environment variables:
SERVER_KEY_PATH
SERVER_CRT_PATH
Use npm run serve:dev-secure with the above mentioned environment variables to start the gui and view in the browser over port 8448
(Note: local server.key and server.crt kan be generated by openssl req -new -sha256 -newkey rsa:2048 -nodes -keyout server.key -x509 -days 365 -out server.crt)
Example:
NPM_CONFIG_APIHOST=https://poms-dev.omroep.nl NPM_CONFIG_SIGNONHOST=https://sso-dev.omroep.nl SERVER_KEY_PATH=~/.secure/server.key SERVER_CRT_PATH=~/.secure/server.crt npm run serve:dev-secure
(Note: running node scripts directly from the console like npm run serve:dev-secure wont work without defining NPM_CONFIG_APIHOST & NPM_CONFIG_SIGNONHOST )
To show POMSUI debugging messages in the console we use a debugging
utility which can be initialised by running commandline commands like DEBUG=pomsui your_command.
This will allow all 'pomsui' namespaced debug messages to be output to the console.
For now, run npm run deploy:gulp to generate just a hand full of files in the build/deploy folder.