Skip to content

Commit

Permalink
switch to env
Browse files Browse the repository at this point in the history
  • Loading branch information
4eyes52 committed Sep 8, 2024
1 parent 0e2df30 commit 5fce46b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
24 changes: 13 additions & 11 deletions apps/nextjs/keystatic.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { collection, config, fields, LocalConfig, GitHubConfig } from "@keystatic/core";
import {
collection,
config,
fields,
GitHubConfig,
LocalConfig,
} from "@keystatic/core";

// // Storage strategy
// const storage: LocalConfig['storage'] | GitHubConfig['storage'] =
Expand All @@ -13,15 +19,13 @@ import { collection, config, fields, LocalConfig, GitHubConfig } from "@keystati
// pathPrefix: 'apps/nextjs'
// }

export default config({
storage: {
kind: "github",
repo: "4eyes52/RealmsWorld",
pathPrefix: "apps/nextjs",
},


const keystaticConfig = config({
storage: {
kind: "github",
repo: "4eyes52/RealmsWorld",
pathPrefix: 'apps/nextjs'
},

ui: {
brand: { name: "Realms.World" },
},
Expand Down Expand Up @@ -199,5 +203,3 @@ import { collection, config, fields, LocalConfig, GitHubConfig } from "@keystati
}),
},
});

export default keystaticConfig;
9 changes: 2 additions & 7 deletions apps/nextjs/src/app/api/keystatic/[...params]/route.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { env } from "@/env";
import { makeRouteHandler } from "@keystatic/next/route-handler";

import keystaticConfig from "../../../../../keystatic.config";
import config from "../../../../../keystatic.config";

export const { POST, GET } = makeRouteHandler({
clientId: env.KEYSTATIC_GITHUB_CLIENT_ID,
clientSecret: env.KEYSTATIC_GITHUB_CLIENT_SECRET,
secret: env.KEYSTATIC_SECRET,
config: keystaticConfig,
});
export const { POST, GET } = makeRouteHandler({ config });

0 comments on commit 5fce46b

Please sign in to comment.