-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create remix nodejs+postgres example
- Loading branch information
1 parent
f0319af
commit edfcc4c
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
npm create remix -- . --template=frontsideair/remix-prisma-postgresql-template --no-install --no-git-init --overwrite | ||
devenv up& | ||
timeout 20 bash -c 'until echo > /dev/tcp/localhost/5100; do sleep 0.5; done' | ||
npx prisma migrate dev && npx prisma db seed | ||
curl -s http://localhost:5100/ | grep "hello" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
```shell-session | ||
$ npm create remix -- . --template=frontsideair/remix-prisma-postgresql-template --no-install --no-git-init --overwrite | ||
$ devenv shell | ||
$ devenv up | ||
$ npx prisma migrate dev | ||
$ npx prisma db seed | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ pkgs, ... }: | ||
|
||
{ | ||
languages.javascript.enable = true; | ||
languages.javascript.npm.install.enable = true; | ||
|
||
processes.remix.exec = "npm run dev"; | ||
|
||
services.postgres = { | ||
enable = true; | ||
initialDatabases = [{ name = "remix"; }]; | ||
initialScript = '' | ||
CREATE USER postgres SUPERUSER; | ||
''; | ||
listen_addresses = "127.0.0.1"; | ||
port = 5432; | ||
}; | ||
|
||
env = { | ||
DATABASE_URL = "postgresql://postgres@127.0.0.1:5432/remix"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
inputs: | ||
nixpkgs: | ||
url: github:NixOS/nixpkgs/nixpkgs-unstable |