Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
HLAMBDA_ADMIN_SECRET="you-must-change-me"

# Optional
#HLAMBDA_ENABLE_ENVIRONMENT_BANNER="true"
#HLAMBDA_ENVIRONMENT_BANNER_NAME="Local Hlambda Demo Development"
#HLAMBDA_ENVIRONMENT_BANNER_MESSAGE="Hello Hlambda Env Banner!"
#HLAMBDA_ENABLE_ENVIRONMENT_BANNER_COLOR="#eeFF22"

# - System
HLAMBDA_ENTRY_POINT_PREFIX="router."
Expand Down
12 changes: 10 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ HLAMBDA_DISABLE_CONSOLE="false"
# Disable 301 redirect from the root path to the `/console`.
HLAMBDA_DISABLE_INITIAL_ROUTE_REDIRECT="false"

# Constant reference in code: ENV_HLAMBDA_DISABLE_CONSOLE_FRONTEND | Default value: false
# Disable static serving of the frontend artefacts from hlambda's public folder.
HLAMBDA_DISABLE_CONSOLE_FRONTEND="false"

# Constant reference in code: ENV_HLAMBDA_CONSOLE_ASSETS_DIR | Default value: public
# If set it will serve console assets from that directory instead of CDN. Using CDN enables system to have lates UI and receive Console hotfixes without the need for updating image.
HLAMBDA_CONSOLE_ASSETS_DIR="public"

# Constant reference in code: ENV_HLAMBDA_METADATA_RELOAD_DEBOUNCE_MS | Default value: 1331
# Debounce ms time to wait before closing the server and reloading metadata.
HLAMBDA_METADATA_RELOAD_DEBOUNCE_MS="1331"
Expand Down Expand Up @@ -94,9 +102,9 @@ HLAMBDA_ENVIRONMENT_BANNER_NAME=""
# Sets message to the environment banner.
HLAMBDA_ENVIRONMENT_BANNER_MESSAGE=""

# Constant reference in code: ENV_HLAMBDA_ENABLE_ENVIRONMENT_BANNER_COLOR | Default value: #FF0000
# Constant reference in code: ENV_HLAMBDA_ENABLE_ENVIRONMENT_BANNER_COLOR | Default value: #fea300
# Selects color of the environment banner.
HLAMBDA_ENABLE_ENVIRONMENT_BANNER_COLOR="#FF0000"
HLAMBDA_ENABLE_ENVIRONMENT_BANNER_COLOR="#fea300"

# Constant reference in code: ENV_HLAMBDA_LIST_OF_PROTECTED_ENV_VARIABLES | Default value: ENV_HLAMBDA_LIST_OF_PROTECTED_ENV_VARIABLES,HLAMBDA_DISABLE_CONSOLE,HLAMBDA_ADMIN_SECRET
# List of the env variable names that are protected from hlambda config override.
Expand Down
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
# Hlambda (/hlæmdə/; hλ;) [Hyper Lambda]
# Hlambda (/hlæmdə/; Hλ;) [Hyper Lambda]

<span><a href="https://www.patreon.com/bePatron?u=70751523" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-green.svg" alt="Patreon donate button" /></a></span>
<span><a href="https://github.com/hlambda/hlambda-core/actions/workflows/publish-docker-image.yml" title="Publish Docker Image"><img src="https://img.shields.io/github/workflow/status/hlambda/hlambda-core/Publish%20Docker%20image" alt="Publish Docker Image" /></a></span>
<span><a href="https://hub.docker.com/r/hlambda/hlambda-core" title="Docker Image"><img src="https://img.shields.io/docker/image-size/hlambda/hlambda-core/latest" alt="Docker Image Size" /></a></span>
<span><a href="https://github.com/hlambda/hlambda-core/blob/master/LICENSE.md" title="License"><img src="https://img.shields.io/github/license/hlambda/hlambda-core" alt="License" /></a></span>

## What is Hlambda (/hlæmdə/) [Hyper Lambda]

Hlambda is ECMAScript meta API service. That means that it offers simple ways to deploy ECMAScript code to local or remote servers.

![Hlambda Banner](https://www.hlambda.io/assets/hlambda-logo-dark.png)
<a href="https://hub.docker.com/r/hlambda/hlambda-core" title="Docker Image">

<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://www.hlambda.io/assets/hlambda-logo-light.png">
<source media="(prefers-color-scheme: light)" srcset="https://www.hlambda.io/assets/hlambda-logo-dark.png">
<img alt="Hlambda Banner" src="https://www.hlambda.io/assets/hlambda-logo-dark.png">
</picture>

</a>

It is the implementation of the idea to load your ECMAScript code as configuration (metadata). With Hlambda you can easily create a microservice that can load arbitrary code configuration.

Expand Down Expand Up @@ -45,15 +58,14 @@ You can check ["Getting started"](https://www.hlambda.io/getting-started/) on ho

- Importing npm packages that are used by the Hlambda Core like;

- "colors": "1.4.0",
- "hlambda": "^0.0.3",
- "colors": "1.4.0"

can cause known issues... like the disabling inherited colors prototype chain unless FORCE_COLOR is set to true.

Exporting errors in hlambda if imported can also cause it to not be visible in the list of errors or constants on the hlambda server.
can cause known issues... like the disabling inherited colors prototype chain unless `FORCE_COLOR` is set to true.

Until addressed this has a simple hotfix to just remove that package from the list of dependencies in your hlambda app, before applying metadata.

- Some of the packages are provided with the hlambda core, but that does not necessarily mean you should use them, you can use your version of packages defined for your hlambda apps.

## Notice

```
Expand Down
17 changes: 10 additions & 7 deletions metadata/apps/example_demo_app/hlambda-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# Defines if the app is enabled or not disabled apps are skipped from importing
enabled: true
# Defines if we want to use namespace or not
use_namespace: true
# Define the namespace name
namespace_name: 'demo_app'
# # Defines if we want to use namespace or not
# use_namespace: true # NOT IN USE!
# # Define the namespace name
# namespace_name: 'demo_app' # NOT IN USE!
# Custom environment variables override for our app
env:
HASURA_GRAPHQL_API_ENDPOINT: "http://graphql-engine:8099/v1/graphql"
HASURA_GRAPHQL_ADMIN_SECRET: "hlambda-test"
YES: "yes"
HAHAH: "YooY"
HLAMBDA_DISABLE_CONSOLE: "false"
#HLAMBDA_ENABLE_ENVIRONMENT_BANNER: "true"
#HLAMBDA_ENVIRONMENT_BANNER_NAME: "Local Hlambda Demo Development"
#HLAMBDA_ENVIRONMENT_BANNER_MESSAGE: "Hello Hlambda Env Banner!"
#HLAMBDA_ENABLE_ENVIRONMENT_BANNER_COLOR: "#eeFF22"

envForce:
HASURA_GRAPHQL_API_ENDPOINT: "http://graphql-engine:8099/v1/graphql"
HASURA_GRAPHQL_ADMIN_SECRET: "realpassword"
SPECIAL_PASSWORD: "realpz"
SPECIAL_PASSWORD: "value-from-env"
HLAMBDA_DISABLE_CONSOLE: "false"
2 changes: 1 addition & 1 deletion metadata/apps/example_hasura/hasura-request-logger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'colors';
// import 'colors'; // This is known issue with this package...

const hasuraRequestLogger = (req, res, next) => {
console.log(`[${req.originalUrl}] Request hit!`);
Expand Down
Loading