1.1.25 • Published 7 days ago

@adobe/helix-universal-devserver v1.1.25

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 days ago

Helic Universal Development Server

Development server for local development of helix universal functions

Status

codecov GitHub Actions GitHub license GitHub issues semantic-release

Installation

$ npm install @adobe/helix-universal-devserver

Usage

// test/dev.js

import { DevelopmentServer } from '@adobe/helix-universal-devserver';
import { main } from '../src/index.js';

async function run() {
 const devServer = await new DevelopmentServer(main).init();
 await devServer.start();
}

run().then(process.stdout).catch(process.stderr);

Test Helix Deploy Bundle

sometimes it is useful to test a bundled universal function directly, for example to verify that all imports are properly resolved. This can be achieved by setting the adapter, either to lambda or lambda.raw. the later bypasses loading of the secrets.

import { lambda } from '../../dist/helix-services/simple-function@2.4.44-bundle.cjs';

async function run() {
  const devServer = await new DevelopmentServer()
    .withHeader('x-forwarded-host', 'localhost:{port}')
    .withAdapter(lambda.raw) // use raw adapter and don't load secrets
    .init();
  await devServer.start();
}

Using development params with the server

Sometimes it might be useful to specify action params that would be provided during deployment but are not available during development. those can be specified by a dev-params-file wsk property. those parameters are loaded an applied to every function call. eg:

{
  // ...
  "wsk": {
    // ...
    "dev-params-file": ".dev-secrets.env"
  },
  // ...
}

Development

Build

$ npm install

Test

$ npm test

Lint

$ npm run lint
1.1.25

7 days ago

1.1.24

14 days ago

1.1.23

17 days ago

1.1.22

21 days ago

1.1.21

22 days ago

1.1.20

23 days ago

1.1.19

28 days ago

1.1.18

1 month ago

1.1.17

1 month ago

1.1.16

1 month ago

1.1.15

1 month ago

1.1.14

1 month ago

1.1.12

1 month ago

1.1.13

1 month ago

1.1.11

2 months ago

1.1.10

2 months ago

1.1.9

2 months ago

1.1.8

2 months ago

1.1.7

2 months ago

1.1.6

2 months ago

1.1.5

2 months ago

1.1.4

2 months ago

1.1.3

3 months ago

1.1.2

3 months ago

1.1.1

3 months ago

1.1.0

3 months ago

1.0.3

3 months ago

1.0.2

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago