Skip to main content

Server Configuration

EcoFlowJS allows you to configure the server as per your needs.

It provides a simple and flexible way to configure server starting directory to router and cors configuration.

Accessing Server Configuration

setup welcome screensetup welcome screen

To access the user management screen:

  1. Click on Settings on the left side panel of the main navigation of your EcoFLowJS application.
  2. Click on Configurations from the sub section.

HTTP Server Configuration

setup welcome screensetup welcome screen

To access the HTTP Server Configurations:

  1. Access the Server Configuration. For more information about how to access the Server Configuration see here.
  2. Click on Server Configurations to open the HTTP Server Configurations.
  3. Fill up the HTTP Server Configurations details:
FieldDescriptionDefault
HostHost for the HTTP server.127.0.0.1
PortPort for the HTTP server.4000
Static Serve UriURI for serving static files./public
HttpsEnable/Disable HTTPS.false
Https keyKey for HTTPS Server.
Https CertificateCertificate for HTTPS Server.false
  1. Commit the changes. For more information see here.

CORS Configuration

setup welcome screensetup welcome screen

To access the CORS Configurations:

  1. Access the Server Configuration. For more information about how to access the Server Configuration see here.
  2. Click on Cors Configurations to open the CORS Configurations.
  3. Fill up the CORS Configurations details:
FieldDescriptionDefault
EnableEnable/Disable CORS settings.true
Cors OriginOrigin to be parsed to CORS.*
Cors AllowMethodsMethods that are allowed for CORS.GET, HEAD, PUT, POST, DELETE, PATCH
Cors ExposeHeadersCORS header to expose.
Cors AllowHeadersAllowed header for CORS.
Cors MaxAgeMax alive time for CORS.0
Cors CredentialsEnable/Disable credentials to pass through CORS.true
Cors KeepHeadersOnErrorCORS keep header on error.false
Cors SecureContextCors secure context.false
Cors PrivateNetworkAccessCors private network access.false
  1. Commit the changes. For more information see here.

API Router Configuration

setup welcome screensetup welcome screen

To access the API Router Configuration:

  1. Access the Server Configuration. For more information about how to access the Server Configuration see here.
  2. Click on API Router Configuration to open the API Router Configuration.
  3. Fill up the API Router Configuration details:
FieldDescriptionDefault
EcoFlow Router PrefixPrefix for the api router./api
EcoFlow Router AllowMethodsMethods that are allowed for the router.GET, PUT, POST, DELETE
EcoFlow Router PathPath to match for all routes.
EcoFlow Router HostHostname to match for all routes.
EcoFlow Router case-sensitiveEnable/Disable routes case sensitive.false
EcoFlow Router Strict ModeEnable/Disable router strict mode.true
EcoFlow Router Exclusive ModeOnly run last matched route's controller when there are multiple matches.false
  1. Commit the changes. For more information see here.

Directory Configuration

setup welcome screensetup welcome screen

To access the Directory Configuration:

  1. Access the Server Configuration. For more information about how to access the Server Configuration see here.
  2. Click on Directory Configuration to open the Directory Configuration.
  3. Fill up the Directory Configuration details:
FieldDescriptionDefault
Base directoryRoot directory for EcoFlowJS to store all information.%HOME DIR%/.ecoflow
Module directoryDirectory where modules are stored.%HOME DIR%/.ecoflow/modules
Flow directoryDirectory where the API Flow Editor flow is stored.%HOME_DIR%/.ecoflow/flows
Environment directoryDirectory where Environment Variables are stored.%HOME_DIR%/.ecoflow/environment
Database directoryDirectory where all database related configs are stored.%HOME DIR%/.ecoflow/Database
Static Serve LocationDirectory for static files.
note

Defaults path for static files are %HOME_DIR%/.ecoflow/public.

  1. Commit the changes. For more information see here.

Flow Configuration

setup welcome screensetup welcome screen

To access the Flow Configuration:

  1. Access the Server Configuration. For more information about how to access the Server Configuration see here.
  2. Click on Flow Configuration to open the Flow Configuration.
  3. Fill up the Flow Configuration details:
FieldDescriptionDefault
Flow definitions file nameName for the flow definition file.nodes.json
Flow connections file nameName for the flow connections file.connections.json
Flow node configurations file nameName for the flow node configurations file.configs.json
Pretty Flow FileEnable/Disable prettify of the flow files.true
  1. Commit the changes. For more information see here.

Logger Configuration

setup welcome screensetup welcome screen

To access the Logger Configuration:

  1. Access the Server Configuration. For more information about how to access the Server Configuration see here.
  2. Click on Logging Configuration to open the Logger Configuration.
  3. Fill up the Logger Configuration details:
FieldDescriptionDefault
Enable LogsEnable/Disable Logger for the application.true
Logs LevelSet logger level.INFO
Logs FormatLogger output format.[ ${timestamp} ] : [ ${label} ] | [ ${level} ] : ${message}
Logs Pretty PrintEnable/Disable prettify of the logger.false
Logs Label EnableEnable/Disable custom label for logger.false
Logs LabelLabel to print in logger.
Logs Enable ConsoleEnable/Disable logger for console.true
Logs Enable FileEnable/Disable logger for file save.false
Logs File LocationDirectory for the logger file to store.
Logs FilenameFile name for the logger log file.
Logs Enable WebEnable/Disable logger for web.false
caution

Logger web logs is still under development and it can either be implement or be removed depending on needs.

  1. Commit the changes. For more information see here.

Editor Configuration

setup welcome screensetup welcome screen

To access the Editor Configuration:

  1. Access the Server Configuration. For more information about how to access the Server Configuration see here.
  2. Click on Editor Configuration to open the Editor Configuration.
  3. Fill up the Editor Configuration details:
FieldDescriptionDefault
Enable EditorsEnable/Disable editors.true
Enable Admin EditorsEnable/Disable admin editors.true
Enable FLow EditorsEnable/Disable fLow editors.true
Editors Schema EnableEnable/Disable schema editors.true
  1. Commit the changes. For more information see here.

System Database Configuration

setup welcome screensetup welcome screen

To access the System Database Configuration:

  1. Access the Server Configuration. For more information about how to access the Server Configuration see here.
  2. Click on System Database Configuration to open the System Database Configuration.
  3. Select your preferred database driver base and configurations accordingly.

Supported Database Drivers:

DatabaseMinimumRecommended
MongoDB5.0.277.0.11
MySQL5.7.88.0
PostgreSQL11.014.0
SQLite33
  1. Commit the changes. For more information see here.

Commit Server Configuration

  1. Click on Confirm to commit the changes.
  2. Confirm the changes by clicking on Confirm in the confirmation modal window.
info

Any changes to the server system database configuration allows you migrate your database or if you want to create a new blank database it also available as option keeping all your data saved in the previous database.

caution
  • Make sure that provided configuration is a valid configuration, any invalid configuration may leads to the crash of your application.
  • Make sure that you know what you are doing, or just leave the configuration unchanged.
tip

In case the application gets crashes due to invalid configuration, can be easily be resolved by restoring the configuration which get automatically backed up during the commitment of the configurations.

To do so, just remove the current configuration present at %HOME DIR%/.ecoflow/config named ecoflow.json and rename latest backed up at same directory to ecoflow.json.

After that restart your application.