Skip to content

Commit

Permalink
feat: use ASTRO_DATABASE_FILE (#21)
Browse files Browse the repository at this point in the history
* feat: use ASTRO_DATABASE_FILE

* chore: eps

* chore: lockfile

* chore: deps
  • Loading branch information
Princesseuh committed May 2, 2024
1 parent d329de8 commit 186ef19
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 110 deletions.
11 changes: 1 addition & 10 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import markdoc from "@astrojs/markdoc";
import tailwind from "@astrojs/tailwind";
import expressiveCode from "astro-expressive-code";
import { defineConfig } from "astro/config";
import { cp, rename } from "fs/promises";
import { rename } from "fs/promises";

import db from "@astrojs/db";

Expand Down Expand Up @@ -43,14 +43,5 @@ export default defineConfig({
},
},
db(),
// Copy the content.db file to the api folder so the serverless function can access it
{
name: "copy-db-api",
hooks: {
"astro:build:generated": async () => {
await cp(new URL(".astro/content.db", import.meta.url), new URL("api/cataloguedb.db", import.meta.url))
},
},
},
],
});
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"private": true,
"scripts": {
"astro": "astro",
"dev": "astro dev",
"dev": "ASTRO_DATABASE_FILE=api/cataloguedb.db astro dev",
"dev:vercel": "vercel dev --listen 4321",
"build": "bash ./scripts/unshallowVercel.sh && astro build",
"build": "bash ./scripts/unshallowVercel.sh && ASTRO_DATABASE_FILE=api/cataloguedb.db astro build",
"preview": "astro preview",
"check": "astro check",
"lint": "eslint . --ext .ts,.js,.astro --report-unused-disable-directives",
Expand All @@ -21,7 +21,7 @@
"@types/prettier": "^2.7.3",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"astro": "4.7.0",
"astro": "^4.7.1",
"eslint": "^8.57.0",
"eslint-plugin-astro": "^1.1.1",
"kleur": "^4.1.5",
Expand All @@ -47,7 +47,7 @@
"dependencies": {
"@11ty/eleventy-fetch": "^4.0.1",
"@astrojs/check": "^0.5.10",
"@astrojs/db": "^0.10.6",
"@astrojs/db": "^0.10.7",
"@astrojs/markdoc": "^0.11.0",
"@types/igdb-api-node": "^5.0.3",
"astro-capo": "^0.0.1",
Expand Down

0 comments on commit 186ef19

Please sign in to comment.