Set up a database with Turso. I chose the name blog-db
but you can use anything you want.
turso db create blog-db
Start up a shell to the database:
turso db shell blog-db
Create the blogs
table:
CREATE TABLE blogs (
title TEXT,
body TEXT
);
Get the URL for the database using the show
command:
turso db show blog-db
And past it into the DATABASE_URL
environment variable. Mine looks like this:
TURSO_URL=libsql://[your database].turso.io
TURSO_TOKEN=***SECRET_TOKEN_HERE***
Get a token for the database:
turso db tokens create blog-db
And add that to the .env
file:
In the root directory run the install command:
npm i
And then run the start command:
npm run dev