ken_nogi/NodeSrv/apps/authgw-poc/src/index.js
Kenichiro NOGI ce58cb4be4 初回コミット: dev配下(NodeSrv/Pleasanter等)をGitea管理下に統合
GitHub(nextgroup2706/ken_nogi)は今後使わず自社Gitea運用に切替え。
NodeSrvは旧リポジトリの履歴を破棄しファイルのみ統合(Dokploy用サービスアカウントは
別途mygit-admin/NodeSrv.gitに履歴あり)。notepmエクスポート(12GB)とPleasanter
インストーラzip(208MB)はサイズが大きいため.gitignoreで除外。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-04 15:37:06 +09:00

28 lines
886 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
// 認証ゲートウェイoauth2-proxyが付与するヘッダーからユーザー情報を取得。
// ローカル開発時Traefik経由なしはフォールバック値を使う。
app.use((req, res, next) => {
req.authUser = {
email: req.headers['x-auth-request-email'] || 'dev-local@next-hd.co.jp',
name: req.headers['x-auth-request-user'] || 'dev-local',
};
next();
});
app.get('/', (req, res) => {
res.send(`<h1>authgw-poc</h1><p>email: ${req.authUser.email}</p><p>name: ${req.authUser.name}</p>`);
});
// Dokploy/Traefikのヘルスチェックが叩くエンドポイント
app.get('/health', (req, res) => {
res.status(200).json({ status: 'healthy' });
});
app.listen(PORT, () => {
console.log(`authgw-poc listening on port ${PORT}`);
});