Skip to content

Commit 5e985f5

Browse files
committed
update: eval base url
1 parent bdef480 commit 5e985f5

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

  • packages/server/src/controllers/evaluations

packages/server/src/controllers/evaluations/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ const createEvaluation = async (req: Request, res: Response, next: NextFunction)
2929
const body = req.body
3030
body.workspaceId = workspaceId
3131

32-
// const httpProtocol = req.get('x-forwarded-proto') || req.get('X-Forwarded-Proto') || req.protocol
33-
// const baseURL = `${httpProtocol}://${req.get('host')}`
34-
const baseURL = `http://localhost:3000`
32+
const baseURL = `${process.env.APP_URL}`
3533
const apiResponse = await evaluationsService.createEvaluation(body, baseURL, orgId, workspaceId)
3634
return res.json(apiResponse)
3735
} catch (error) {
@@ -55,8 +53,7 @@ const runAgain = async (req: Request, res: Response, next: NextFunction) => {
5553
`Error: evaluationsService.runAgain - workspace ${workspaceId} not found!`
5654
)
5755
}
58-
const httpProtocol = req.get('x-forwarded-proto') || req.get('X-Forwarded-Proto') || req.protocol
59-
const baseURL = `${httpProtocol}://${req.get('host')}`
56+
const baseURL = `${process.env.APP_URL}`
6057
const apiResponse = await evaluationsService.runAgain(req.params.id, baseURL, orgId, workspaceId)
6158
return res.json(apiResponse)
6259
} catch (error) {

0 commit comments

Comments
 (0)