Skip to content

Commit a9806f3

Browse files
chadiiichadiii
chadiii
authored and
chadiii
committed
wording
1 parent 51126e3 commit a9806f3

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

example/dev/backend/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ app.get('/with_module', (req, res) => {
1616

1717
app.get('/without_module', (req, res) => {
1818

19-
Flagship.start("c0n48jn5thv01k0ijmo0", "BsIK86oh7c12c9G7ce4Wm1yBlWeaMf3t1S0xyYzI");
19+
// replace envId & apiKey with your own flagship credentials
20+
Flagship.start("envId", "apiKey");
2021

2122
const visitor_id = req.get('x-visitor-id')
2223
const visitor_context = req.get('x-visitor-context')

example/dev/config/nginx-conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ server {
6060
server_name _;
6161
error_log /var/log/nginx/error.log debug;
6262

63-
fs_init 'c0n48jn5thv01k0ijmo0' 'BsIK86oh7c12c9G7ce4Wm1yBlWeaMf3t1S0xyYzI' '500' 'ERROR' '0';
63+
# replace envId & apiKey with your own flagship credentials, for pollingInterval, logLevel, trackingEnabled check the documentation
64+
fs_init 'envId' 'apiKey' 'pollingInterval' 'logLevel' 'trackingEnabled';
6465

6566
location /with_module {
6667

example/standalone/config/nginx-conf

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=my_cache:10m;
2323

2424

2525
map $http_user_agent $browser_type {
26-
default "Edge";
26+
default "Edge";
2727
"~Mozilla.*Firefox*" "Firefox";
2828
"~Chrome*" "Chrome";
2929
}
@@ -57,9 +57,10 @@ server {
5757
server_name _;
5858
error_log /var/log/nginx/error.log debug;
5959

60-
fs_init 'c0n48jn5thv01k0ijmo0' 'BsIK86oh7c12c9G7ce4Wm1yBlWeaMf3t1S0xyYzI' '500' 'ERROR' '0';
60+
# replace envId & apiKey with your own flagship credentials, for pollingInterval, logLevel, trackingEnabled check the documentation
61+
fs_init 'envId' 'apiKey' 'pollingInterval' 'logLevel' 'trackingEnabled';
6162

62-
location /with_module {
63+
location /with_cache {
6364

6465
fs_visitor_id $request_id;
6566
fs_visitor_context browser:$browser_type;
@@ -71,7 +72,6 @@ server {
7172
proxy_cache my_cache;
7273
proxy_cache_valid any 10m;
7374

74-
add_header X-Proxy-Cache $upstream_cache_status;
7575
add_header X-Flags $fs_flags;
7676
add_header X-Browser_type $browser_type;
7777

@@ -85,26 +85,18 @@ server {
8585

8686
return 200 $fs_flags;
8787
}
88-
89-
location /without_module {
9088

91-
proxy_buffering on;
92-
proxy_cache my_cache;
93-
proxy_cache_valid any 10m;
94-
95-
add_header X-Proxy-Cache $upstream_cache_status;
96-
97-
set $visitor_context browser:$browser_type;
89+
location /without_cache {
9890

99-
proxy_set_header X-Visitor-Id $request_id;
100-
proxy_set_header X-Visitor-Context $visitor_context;
91+
fs_visitor_id $browser_type;
92+
fs_visitor_context example:version1;
93+
fs_get_all_flags;
10194

10295
default_type text/html;
10396

10497
return 200 $fs_flags;
105-
10698
}
107-
99+
108100
# pass PHP scripts to FastCGI server
109101
#
110102
#location ~ \.php$ {

0 commit comments

Comments
 (0)