- github actions
- Whole documentation is prepared by using openapi schema.
- To se the documentation please run
npm run start
ornpm run start:watch
and go to the running server i.ex.localhost:3000
under/.well-known/documentation
. - Next you can start the mock server by using
npm run start:local:mock
ornpm run start:local:mock:watch
. - You can the enter a whole url like
http://localhost:3001/api/v1/dashboard
an you will see the static examples served by the mock server. - Then you can:
- change the examples like
http://localhost:3001/api/v1/dashboard?__example=positiv
- where you can set the__example
param with any example provided in the./src/docs/examples/
directory. - set a dynamic mock (but it's not very useful and I don't know how to deal with it) by http://localhost:3001/api/v1/dashboard?__dynamic=true
- Follow the
positive_example
example. - Go to
openapi.json
and set what's needed. - Go to
./src/docs/examples
and create what's needed.
When deploying app in local environment create .env
file in root directory which contains:
GATEWAY_URL='https://gate.patronage2020-iot.intive-projects.com'
COOKIE_NAME='____________'
COOKIE_VALUE='________________________'
COOKIE_NAME
and COOKIE_VALUE
are optional and should be both defined when cookie authentication is desirable.
To set cookie in browser, paste following code into browser console. It is required when COOKIE_NAME
and COOKIE_VALUE
are defined in environment variables.
var doSetCookie = function setCookie (c_name, value, exdays) {
var exdate = new Date()
exdate.setDate(exdate.getDate() + exdays)
var c_value = escape(value) + ((exdays == null) ? '' : '; expires=' + exdate.toUTCString())
document.cookie = c_name + '=' + c_value + '; samesite=Lax'
}
doSetCookie('___________', '___________________', 1)
In order to have hot reload run scripts:
npm run start:watch
npm run build:frontend:dev
Backend will serve new builds as frontend will be rebuilded on changes.