Skip to content

Latest commit

 

History

History

hello-nginx

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

LaunchDarkly Lua server-side SDK NGINX example

We've built a minimal dockerized example of using the Lua SDK with OpenResty NGINX framework. For more comprehensive instructions, you can visit the Using the Lua SDK with NGINX guide or the Lua reference guide.

Build instructions

  1. On the command line from the root of the repo, build the image from this directory with docker build -t hello-nginx -f ./examples/hello-nginx/Dockerfile ..
  2. Run the demo with
    docker run --rm --name hello-nginx -p 8123:80 --env LAUNCHDARKLY_SDK_KEY="my-sdk-key" --env LAUNCHDARKLY_FLAG_KEY="my-boolean-flag" hello-nginx
  3. Note: the SDK key and flag key are passed with environment variables into the container. The LAUNCHDARKLY_FLAG_KEY should be a boolean-type flag in your environment.
  4. Open localhost:8123 in your browser. Toggle the flag on to see a change in the page (refresh the page.)

You should receive the message:

The (flag key) feature flag evaluates to (true/false).