@conclurer/edelog-portal-server
v1.5.1
Published
Provides a microservice for hosting an Edelog portal that can be managed using Edelog's Portal Builder
Downloads
2
Keywords
Readme
Edelog Portal Server
This package contains the basic foundation of Edelog Portal Server. Microservices using this package are intended to be managed by Edelog Portal Builder but it can also function standalone.
Setup
In order to use Edelog Portal Server you have to register a manually deployed portal using Portal Builder.
Create a js file that will functioning as entry point for the server.
Example:
import providePortalServer from '@conclurer/edelog-portal-server';
providePortalServer({
portalAccessId: '',
portalAccessSecretKey: '',
edelogApiBaseUrl: 'https://app.edelog.com/',
portalBuilderApiBaseUrl: 'https://pb.industrial.edelog.com/',
expressConfig: {
port: 4000,
},
});
You can also omit these variables and fallback to the corresponding ENV vars: EDELOG_API_BASE_URL
, PORTAL_BUILDER_API_BASE_URL
, PORTAL_ACCESS_ID
, PORTAL_ACCESS_SECRET_KEY
and PORT
.
Project Structure
Your project folder is expected to have this format:
- index.js (*)
- locales
- de.json
- en.json
- ...
- static
- index.html (*)
- ...
The files with (*) are required.
The locales folder contains locale overwrites. By default, Edelog Portal Server will fallback to Edelog's language files. If you specify a language file, you can partially overwrite some language strings.
Language strings are specified in the following way (example en.json
):
{
"en": {
"next": {
"buttons": {
"save": "Overwritten Label"
}
}
}
}
The static folder contains the html files for the frontend of the portal. When being automatically deployed, Edelog Portal Builder will create a build of Edelog Portal Frontend using the following command:
ng build --prod=true --aot=true --buildOptimizer=true --deployUrl=/static/
Edelog Portal Server's underlying Express configuration will redirect any non-matching request to static/index.html
.
Usage
To start the server, simply run node index.js
(assuming index.js
is your main file).