|
|
@@ -1,12 +1,15 @@
|
|
|
import { Context, Hono, Next } from "hono"
|
|
|
-import UserRoute from "./routes/users-route"
|
|
|
-import AuthRoute from "./routes/auth-route"
|
|
|
+
|
|
|
import { cors } from "hono/cors"
|
|
|
import { jwt, decode, sign, verify } from "hono/jwt"
|
|
|
import { logger } from "hono/logger"
|
|
|
import { showRoutes } from "hono/dev"
|
|
|
import { HTTPException } from "hono/http-exception"
|
|
|
|
|
|
+import UserRoute from "./routes/users-route"
|
|
|
+import AuthRoute from "./routes/auth-route"
|
|
|
+import RcsRoute from "./routes/rcs-route"
|
|
|
+
|
|
|
const app = new Hono<Environment>()
|
|
|
|
|
|
const jwtMiddleware = (c: Context, next: Next) => {
|
|
|
@@ -21,6 +24,7 @@ app.use("/users/*", jwtMiddleware)
|
|
|
|
|
|
app.route("/auth", AuthRoute)
|
|
|
app.route("/users", UserRoute)
|
|
|
+app.route("/rcs", RcsRoute)
|
|
|
|
|
|
app.onError(async (err, c) => {
|
|
|
if (err instanceof HTTPException) {
|