Skip to content

Commit

Permalink
feat: add header
Browse files Browse the repository at this point in the history
  • Loading branch information
KagamiChan committed Oct 17, 2024
1 parent 390d8d4 commit 7a90966
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { execa } from 'execa'

const commitHash = await execa('git', ['rev-parse', 'HEAD'])
const now = new Date().toISOString()

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand All @@ -13,8 +14,31 @@ const nextConfig = {
trailingSlash: true,
env: {
COMMIT_HASH: commitHash.stdout,
BUILD_DATE: new Date().toISOString(),
BUILD_DATE: now,
},
headers: async () => [
{
source: '/:path*',
headers: [
{
key: 'X-Poi-Codename',
value: 'Asashio',
},
{
key: 'X-Poi-Revision',
value: commitHash.stdout ?? 'development',
},
{
key: 'X-Poi-Build-Date',
value: now,
},
{
key: 'X-Poi-Greetings',
value: 'poi?',
},
],
},
],
}

export default nextConfig

0 comments on commit 7a90966

Please sign in to comment.