Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

launchdarkly/hello-lua-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Important

Please see Lua Server SDK for the most up-to-date hello-lua-server. This repo is deprecated.

LaunchDarkly sample Lua server-side application

We've built a simple console application that demonstrates how LaunchDarkly's SDK works. Below, you'll find the build procedure. For more comprehensive instructions, you can visit your Quickstart page or the Lua reference guide.

Dependencies

You will need the shared library for the LaunchDarkly c-server-sdk. You can automatically download the lua-server-sdk and c-server-sdk with download.sh. The c-server-sdk shared library must be accessible by the linker at run time. This project is built with luarocks.

The download.sh script is not suitable for a production or CI environment.

Instructions

  1. Install the dependencies described above.
  2. Edit hello.lua and set the value of YOUR_SDK_KEY to your LaunchDarkly SDK key. If there is an existing boolean feature flag in your LaunchDarkly project that you want to evaluate, set YOUR_FEATURE_KEY to the flag key.
local YOUR_SDK_KEY = "1234567890abcdef"

local YOUR_FEATURE_KEY = "my-boolean-flag"
  1. On the command line, build the SDK with sudo luarocks make launchdarkly-server-sdk-1.0-0.rockspec LD_DIR=. LD_INCDIR=./include.
  2. On the command line, run LD_LIBRARY_PATH=. luajit hello.lua or LD_LIBRARY_PATH=. lua hello.lua.