Skip to content

Commit f2bb74b

Browse files
committed
edit how json loads
1 parent 70f0b04 commit f2bb74b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/middleware/common.middleware.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ import { errorTemplateContext, MiddlewareError } from '../utils/errors.js'
1515
import { dataRangeParams } from '../routes/schemas.js'
1616
import platformApi from '../services/platformApi.js'
1717
import config from '../../config/index.js'
18-
import planFallback from '../../config/plan-fallback.json' with { type: 'json' }
18+
import { readFileSync } from 'node:fs'
1919

20+
const planFallback = JSON.parse(readFileSync(new URL('../../config/plan-fallback.json', import.meta.url), 'utf8'))
2021
/**
2122
* Middleware. Set `req.handlerName` to a string that will identify
2223
* the function that threw the error.

0 commit comments

Comments
 (0)