Skip to content

Commit

Permalink
chore: version
Browse files Browse the repository at this point in the history
shift to extra const file
  • Loading branch information
seaerchin committed May 29, 2024
1 parent ca71ab6 commit d8fc36d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions support/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const ROUTE_VERSION = "v2"
5 changes: 3 additions & 2 deletions support/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useSharedMiddleware } from "@common/middleware"
import { config } from "@root/config/config"
import logger from "@root/logger/logger"

import { ROUTE_VERSION } from "./constants"
import { v2Router } from "./routes"
import { isobotRouter } from "./routes/v2/isobot"

Expand All @@ -17,12 +18,12 @@ const app = express()
// poller site launch updates
infraService.pollMessages()

const ROUTE_PREFIX_ISOBOT = "/v2/isobot"
const ROUTE_PREFIX_ISOBOT = `/${ROUTE_VERSION}/isobot`
app.use(ROUTE_PREFIX_ISOBOT, isobotRouter)

useSharedMiddleware(app)
app.use("/", v2Router)
app.use("/v2/ping", (req, res) => res.status(200).send("Ok"))
app.use(`/${ROUTE_VERSION}/ping`, (req, res) => res.status(200).send("Ok"))

sequelize
.authenticate()
Expand Down
4 changes: 3 additions & 1 deletion support/routes/v2/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import express from "express"

import { ROUTE_VERSION } from "../../constants"

import { formSgRouter } from "./formsg"

const ROUTE_PREFIX = "/v2/infra"
const ROUTE_PREFIX = `/${ROUTE_VERSION}/infra`

export const v2Router = express.Router()

Expand Down

0 comments on commit d8fc36d

Please sign in to comment.