Skip to content

Commit

Permalink
config tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
4eyes52 committed Sep 7, 2024
1 parent d07f293 commit c105484
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/api/keystatic/[...params]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const { POST, GET } = makeRouteHandler({
clientId: process.env.KEYSTATIC_GITHUB_CLIENT_ID,
clientSecret: process.env.KEYSTATIC_GITHUB_CLIENT_SECRET,
secret: process.env.KEYSTATIC_SECRET,
config,
config
});
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/api/trpc/[trpc]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
import { appRouter, createTRPCContext } from "@realms-world/api";
import { auth } from "@realms-world/auth";

export const runtime = "edge";


/**
* Configure basic CORS headers
Expand Down
11 changes: 6 additions & 5 deletions apps/nextjs/src/utils/keystatic.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import path from "path";
import type { Entry } from "@keystatic/core/reader";
import { createReader } from "@keystatic/core/reader";
import { createGitHubReader } from '@keystatic/core/reader/github';

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

/**
* Instruct Next.js to include content directory in serverless function 😵
* Without this Next.js wont be able to do static analysis and "content" directory will not be available in serverless function
*/
path.join(process.cwd(), "content");
//path.join(process.cwd(), "content");

export const reader = createReader(process.cwd(), keystaticConfig);
export const reader = createReader(process.cwd(), config);

export type CollectionEntry<
T extends keyof (typeof keystaticConfig)["collections"],
> = Entry<(typeof keystaticConfig)["collections"][T]>;
T extends keyof (typeof config)["collections"],
> = Entry<(typeof config)["collections"][T]>;

0 comments on commit c105484

Please sign in to comment.