Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
feat: add debug endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
samerbuna committed Dec 29, 2022
1 parent fbc938d commit e85d34b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-wallet",
"version": "0.0.1",
"version": "0.1.0",
"private": true,
"license": "MIT",
"scripts": {
Expand Down
16 changes: 16 additions & 0 deletions src/server/ssr-router.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
import express from "express"

import { execSync } from "child_process"

import { serverRenderer } from "renderers/server"
import { checkRoute, routeRequiresAuth } from "server/routes"
import { handleRegister, handleLogin, handleRecovery, handleLogout } from "kratos/index"
import { config } from "store/index"

const ssrRouter = express.Router({ caseSensitive: true })

ssrRouter.get("/debug", async (req, res) => {
const headHash = execSync("git rev-parse HEAD").toString().trim()
res.send({
packageVersion: process.env.npm_package_version,
headHash,
network: config.network,
graphqlUrl: config.graphqlUrl,
graphqlSubscriptionUrl: config.graphqlSubscriptionUrl,
authEndpoint: config.authEndpoint,
kratosBrowserUrl: config.kratosBrowserUrl,
galoyAuthEndpoint: config.galoyAuthEndpoint,
})
})

ssrRouter.get("/verified", (req, res) => {
req.session = req.session || {}
req.session.emailVerified = true
Expand Down

0 comments on commit e85d34b

Please sign in to comment.