Skip to content

Commit

Permalink
Vercel update
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjonstrup committed Mar 17, 2024
1 parent 8adcd37 commit b05869c
Show file tree
Hide file tree
Showing 6 changed files with 391 additions and 26 deletions.
6 changes: 5 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind';
// Import /serverless for a Serverless SSR site
import vercelServerless from '@astrojs/vercel/serverless';

import db from '@astrojs/db';

// https://astro.build/config
export default defineConfig({
output: 'server',
adapter: vercelServerless(),
integrations: [tailwind(), db()],
});
});
56 changes: 35 additions & 21 deletions db/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,49 @@ import { db, Comment, Author, Course } from 'astro:db';
// https://astro.build/db/seed
export default async function seed() {
await db.insert(Author).values([
{ id: 1, name: 'Testing'},
{ id: 2, name: 'Tester'}
{ id: 1, name: 'Testing' },
{ id: 2, name: 'Tester' },
]);

await db.insert(Comment).values([
{ authorId: 1, body: 'dope you like Astro DB!',flagged: false, likes: 0, metadata: '', published: new Date()},
{ authorId: 2, body: 'Enjoy',flagged: false, likes: 0, metadata: '', published: new Date()},
{
authorId: 1,
body: 'dope you like Astro DB!',
flagged: false,
likes: 0,
metadata: '',
published: new Date(),
},
{
authorId: 2,
body: 'Enjoy',
flagged: false,
likes: 0,
metadata: '',
published: new Date(),
},
]);

await db.insert(Course).values([
{
id: 1,
title: 'Spanish',
imageSrc: '/es.svg'
imageSrc: '/es.svg',
},
{
id: 2,
title: 'Italian',
imageSrc: '/it.svg',
},
{
id: 2,
title: "Italian",
imageSrc: "/it.svg",
},
{
id: 3,
title: "French",
imageSrc: "/fr.svg",
},
{
id: 4,
title: "Croatian",
imageSrc: "/hr.svg",
},
])
{
id: 3,
title: 'French',
imageSrc: '/fr.svg',
},
{
id: 4,
title: 'Croatian',
imageSrc: '/hr.svg',
},
]);
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@astrojs/check": "^0.5.9",
"@astrojs/db": "^0.8.6",
"@astrojs/tailwind": "^5.1.0",
"@astrojs/vercel": "7.3.6",
"astro": "^4.5.5",
"sharp": "0.33.2",
"tailwindcss": "^3.4.1",
Expand Down
Loading

0 comments on commit b05869c

Please sign in to comment.