Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/launchdarkly/hello-bootstrap
Hello LaunchDarkly for bootstrapping in Node.js
https://github.com/launchdarkly/hello-bootstrap
bootstrap examples feature-flags feature-toggles javascript js launchdarkly sdk-examples
Last synced: 3 months ago
JSON representation
Hello LaunchDarkly for bootstrapping in Node.js
- Host: GitHub
- URL: https://github.com/launchdarkly/hello-bootstrap
- Owner: launchdarkly
- License: apache-2.0
- Created: 2018-06-20T22:17:38.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-06-27T22:42:19.000Z (about 1 year ago)
- Last Synced: 2024-01-21T23:09:51.828Z (5 months ago)
- Topics: bootstrap, examples, feature-flags, feature-toggles, javascript, js, launchdarkly, sdk-examples
- Language: EJS
- Homepage:
- Size: 69.3 KB
- Stars: 5
- Watchers: 43
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-launchdarkly - Node.js bootstrapping server-side app LaunchDarkly
README
# LaunchDarkly sample Node.js (server-side) application with bootstrapping
We've built a simple Node.js app that demonstrates LaunchDarkly server-side bootstrapping.
Below, you'll find the build and deploy procedures. To learn more about the Node.js SDK, read [Node.js (server-side) SDK reference](https://docs.launchdarkly.com/sdk/server-side/node-js).
## Build instructions
Make sure you have [Node.js](http://nodejs.org/) installed. Then, clone the repository, set the `LD_SDK_KEY` and `LD_CLIENTSIDE_ID` environment variables, and start your local server. Here's how:
```sh
$ git clone [email protected]:launchdarkly/hello-bootstrap.git # or clone your own fork
$ cd hello-bootstrap
$ export LD_SDK_KEY=YOUR-SDK-KEY
$ export LD_CLIENTSIDE_ID=YOUR-CLIENTSIDE-ID
$ npm install
$ npm start
```Your app should now be running on [localhost:5000](http://localhost:5000/).
Your app should display a JSON representation of all flags in the project and environment associated with your SDK key and Client-side ID, with the values served for both the normal client and the bootstrapped client for the example user.
## Deploying to Heroku
If you are using Heroku, you can also deploy there. Make sure you have the [Heroku CLI](https://cli.heroku.com/) installed.
```sh
$ heroku create
$ heroku config:set LD_SDK_KEY=YOUR-SDK-KEY
$ heroku config:set LD_CLIENTSIDE_ID=YOUR-CLIENTSIDE-ID
$ git push heroku main
$ heroku open
```
or[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)