Skip to content

Commit

Permalink
prerender false
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronlifton committed Mar 22, 2024
1 parent b6ee8f6 commit 16f8c0b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN --mount=type=secret,id=env,dst=/etc/secrets/.env \
TURSO_DB_AUTH_TOKEN=$(grep TURSO_DB_AUTH_TOKEN /etc/secrets/.env | cut -d '=' -f 2) \
TURSO_DB_URL=$(grep TURSO_DB_URL /etc/secrets/.env | cut -d '=' -f 2) \
export TURSO_DB_URL && export TURSO_DB_AUTH_TOKEN \
&& ln -s /etc/secrets/env .env \
&& cp /etc/secrets/env .env \
&& npm install \
&& npm run prisma-generate \
&& npm run build
Expand Down
13 changes: 7 additions & 6 deletions src/pages/api/blog/views/[slug].json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import { getViewsBySlug } from "$/services/turso.js";
// const getViewsFn = import.meta.env.PROD ? getViewsBySlug : inMemoryGetViews;
const getViewsFn = getViewsBySlug;

export async function getStaticPaths() {
const posts = await getCollection("blog");
return posts.map((post) => ({
params: { slug: post.slug },
}));
}
export const prerender = false;
// export async function getStaticPaths() {
// const posts = await getCollection("blog");
// return posts.map((post) => ({
// params: { slug: post.slug },
// }));
// }

export const GET: APIRoute = async ({ params, request }) => {
let views: Value | number = 0;
Expand Down
2 changes: 1 addition & 1 deletion vite.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "node:path";
// import { loadEnv } from "vite";
import { loadEnv } from "vite";

// const env = loadEnv(process.env.NODE_ENV, process.cwd(), "");

Expand Down

0 comments on commit 16f8c0b

Please sign in to comment.