@fab/plugin-add-fab-id

1.1.1 • Public • Published

@fab/plugin-add-fab-id

Drop this into your fab.config.json5 to add X-FAB-ID to outgoing requests:

{
  plugins: {
    // ...
    '@fab/plugin-add-fab-id': {},
    // ...
  }
}
> curl -I http://localhost:3000
HTTP/1.1 200 OK
X-Powered-By: Express
content-type: text/html; charset=utf-8
X-FAB-ID: 1a0b0d929c5c46c3ecd37d362b9a7a6f
Content-Length: 70662
ETag: W/"11406-PuPRFA3W8a7l9h+fkybbSwTtsO4"
Date: Tue, 23 Jun 2020 18:28:28 GMT
Connection: keep-alive

See https://fab.dev for more info.

Customisation

You can pass a header argument to change which HTTP header is used:

{
  plugins: {
    // ...
    '@fab/plugin-add-fab-id': {
      header: 'X-SOMETHING-ELSE'
    },
    // ...
  }
}
> curl -I http://localhost:3000
HTTP/1.1 200 OK
X-Powered-By: Express
content-type: text/html; charset=utf-8
X-SOMETHING-ELSE: 24c5e0be45fcf1dd2aa75a432823dbbc
Content-Length: 70662
ETag: W/"11406-PuPRFA3W8a7l9h+fkybbSwTtsO4"
Date: Tue, 23 Jun 2020 18:30:33 GMT
Connection: keep-alive

Note: our FAB ID actually changed when we set a new header for this plugin, since any change to a FAB results in a new FAB ID, one of FAB's production guarantees.

Readme

Keywords

none

Package Sidebar

Install

npm i @fab/plugin-add-fab-id

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

13.4 kB

Total Files

17

Last publish

Collaborators

  • evanderkoogh
  • geelen