Skip to content

Commit

Permalink
Generate a request ID
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Feb 5, 2023
1 parent 2c80df9 commit b0e9eac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import AutoLoad from '@fastify/autoload'
import { join } from 'path'
import desm from 'desm'
import hyperid from 'hyperid'

const __dirname = desm(import.meta.url)
const hid = hyperid()

export default async function App (fastify, opts) {
// Place here your custom code!
Expand Down Expand Up @@ -34,5 +36,6 @@ export default async function App (fastify, opts) {

export const options = {
// TODO: get this out of env from fly
trustProxy: true
trustProxy: true,
genReqId: function (req) { return hid() }
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"format-duration": "^3.0.0",
"fragmentions": "^1.1.3",
"highlight.js": "^11.5.0",
"hyperid": "^3.1.1",
"jsonfeed-to-rss": "^3.0.6",
"local-storage-proxy": "^4.0.3",
"lru-cache": "^7.13.1",
Expand Down

0 comments on commit b0e9eac

Please sign in to comment.