Download spectrum/shared/middlewares/statsd.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 515 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/middlewares/statsd.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/shared/middlewares/statsd.js
-
curl -L -o statsd.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/middlewares/statsd.js
515 Bytes
| // @flow | |
| import statsdMiddleware from 'express-hot-shots'; | |
| import { statsd } from '../statsd'; | |
| const middleware = statsdMiddleware({ | |
| client: statsd, | |
| }); | |
| export default ( | |
| req: express$Request, | |
| res: express$Response, | |
| next: express$NextFunction | |
| ) => { | |
| // Set a sensible default req.statsdKey, which is what will be shown in the DataDog UI. Example key: | |
| // hyperion.http.get | |
| // $FlowFixMe | |
| req.statsdKey = `http.${req.method.toLowerCase() || 'unknown_method'}`; | |
| return middleware(req, res, next); | |
| }; | |