Update README, give session cookie secrets with .env

This commit is contained in:
Joonas 2023-11-21 13:16:15 +02:00
parent 486002b0bc
commit 21638570eb
3 changed files with 12 additions and 36 deletions

2
.env.example Normal file
View File

@ -0,0 +1,2 @@
DATABASE_URL="file:./dev.db"
TC_SECRETS="<very secret string of letters that no one knows here>"

View File

@ -1,38 +1,11 @@
# Welcome to Remix!
- [Remix Docs](https://remix.run/docs)
## Development
From your terminal:
```sh
npm run dev
# Twitter Clone
A literal Twitter Clone. It is made with Remix, Prisma and Tailwind CSS.
## Running for dev or prod
Clone the repo, install dependencies, put secrets in .env, run the migration and start.
```
This starts your app in development mode, rebuilding assets on file changes.
## Deployment
First, build your app for production:
```sh
npm run build
git clone https://git.disroot.org/qwertyasdfgh/twitter-clone
pnpm install
pnpm prisma migrate deploy/dev
cp .env.example .env // edit the file!!!
pnpm start/dev
```
Then run the app in production mode:
```sh
npm start
```
Now you'll need to pick a host to deploy it to.
### DIY
If you're familiar with deploying node applications, the built-in Remix app server is production-ready.
Make sure to deploy the output of `remix build`
- `build/`
- `public/build/`

View File

@ -4,6 +4,7 @@ export const { getSession, commitSession, destroySession } =
createCookieSessionStorage({
cookie: {
path: "/",
secrets: [process.env.TC_SECRETS || ""],
sameSite: "strict",
},
});