flagsmith-nodejs 2.2.2-beta.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +10 -8
- package/build/sdk/index.d.ts +5 -17
- package/build/sdk/index.js +2 -0
- package/build/sdk/types.d.ts +19 -1
- package/build/sdk/utils.d.ts +2 -2
- package/{es6-example → examples/api-proxy}/.babelrc +0 -0
- package/{es6-example → examples/api-proxy}/.eslintrc +0 -0
- package/examples/api-proxy/.idea/api-proxy.iml +12 -0
- package/examples/api-proxy/.idea/codeStyles/Project.xml +60 -0
- package/examples/api-proxy/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/examples/api-proxy/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/examples/api-proxy/.idea/modules.xml +8 -0
- package/examples/api-proxy/.idea/vcs.xml +6 -0
- package/examples/api-proxy/README.md +12 -0
- package/examples/api-proxy/package-lock.json +10895 -0
- package/examples/api-proxy/package.json +57 -0
- package/examples/api-proxy/src/api/index.js +42 -0
- package/{es6-example → examples/api-proxy}/src/index.js +0 -0
- package/examples/basic/.babelrc +3 -0
- package/examples/basic/.eslintrc +8 -0
- package/examples/basic/README.md +10 -0
- package/{es6-example → examples/basic}/package-lock.json +235 -38
- package/{es6-example → examples/basic}/package.json +1 -0
- package/examples/basic/src/api/index.js +33 -0
- package/{example/server → examples/basic/src}/index.js +4 -4
- package/examples/caching/.babelrc +3 -0
- package/examples/caching/.eslintrc +8 -0
- package/examples/caching/README.md +9 -0
- package/examples/caching/package-lock.json +10782 -0
- package/examples/caching/package.json +56 -0
- package/{example/server → examples/caching/src}/api/index.js +7 -11
- package/examples/caching/src/index.js +29 -0
- package/examples/custom-fetch-agent/.babelrc +3 -0
- package/examples/custom-fetch-agent/.eslintrc +8 -0
- package/examples/custom-fetch-agent/README.md +12 -0
- package/examples/custom-fetch-agent/package-lock.json +10782 -0
- package/examples/custom-fetch-agent/package.json +56 -0
- package/examples/custom-fetch-agent/src/api/index.js +34 -0
- package/examples/custom-fetch-agent/src/index.js +29 -0
- package/examples/local-evaluation/.babelrc +3 -0
- package/examples/local-evaluation/.eslintrc +8 -0
- package/examples/local-evaluation/README.md +18 -0
- package/examples/local-evaluation/package-lock.json +10782 -0
- package/examples/local-evaluation/package.json +56 -0
- package/{es6-example → examples/local-evaluation}/src/api/index.js +2 -13
- package/examples/local-evaluation/src/index.js +29 -0
- package/index.ts +4 -0
- package/package.json +1 -1
- package/sdk/index.ts +8 -15
- package/sdk/types.ts +19 -2
- package/sdk/utils.ts +2 -2
- package/tests/sdk/flagsmith.test.ts +25 -10
- package/es6-example/README.md +0 -62
- package/example/LICENSE +0 -0
- package/example/Procfile +0 -1
- package/example/README.md +0 -15
- package/example/package-lock.json +0 -2387
- package/example/package.json +0 -27
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import http from 'http'
|
|
2
|
+
import express from 'express'
|
|
3
|
+
import bodyParser from 'body-parser'
|
|
4
|
+
import api from './api'
|
|
4
5
|
const PORT = process.env.PORT || 3000;
|
|
5
6
|
const app = express();
|
|
6
|
-
const bodyParser = require('body-parser');
|
|
7
7
|
|
|
8
8
|
app.server = http.createServer(app);
|
|
9
9
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<img width="100%" src="https://github.com/Flagsmith/flagsmith/raw/main/static-files/hero.png"/>
|
|
2
|
+
|
|
3
|
+
# Flagsmith Node.js example with caching
|
|
4
|
+
|
|
5
|
+
This is a simple Flagsmith Node.js example that uses node-cache as a way to cache flags and identities with a TTL. This can also be used with other implementations such as Redis, see [here](https://docs.flagsmith.com/v1.0/clients/node#caching-data) for more information.
|
|
6
|
+
```shell
|
|
7
|
+
npm i
|
|
8
|
+
npm run dev
|
|
9
|
+
```
|