Skip to content

Commit

Permalink
Create remix nodejs+postgres example
Browse files Browse the repository at this point in the history
  • Loading branch information
frontsideair committed Mar 1, 2024
1 parent f0319af commit edfcc4c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/remix/.test.sh
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"
8 changes: 8 additions & 0 deletions examples/remix/README.md
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
```

22 changes: 22 additions & 0 deletions examples/remix/devenv.nix
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";
};
}
3 changes: 3 additions & 0 deletions examples/remix/devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable

0 comments on commit edfcc4c

Please sign in to comment.