1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-02-03 15:48:40 +00:00

Compare commits

...

5 commits

Author SHA1 Message Date
dependabot[bot]
79e65ab066
Merge 56dee07890 into 4db8537fe4 2023-12-19 11:35:25 +00:00
4db8537fe4
metadata export 2023-12-19 14:51:46 +09:00
f1780f541b
create makefile 2023-12-19 14:37:53 +09:00
87aeeafd13
update 2023-12-19 14:23:30 +09:00
4993bec7dc
update 2023-12-19 14:05:09 +09:00
16 changed files with 320 additions and 342 deletions

7
hasura-rest/Makefile Normal file
View file

@ -0,0 +1,7 @@
.env:
touch .env
chmod 600 .env
echo POSTGRES_PASSWORD=$(shell openssl rand -hex 32) >> .env
echo HASURA_GRAPHQL_ADMIN_SECRET=$(shell openssl rand -hex 32) >> .env
echo HASURA_GRAPHQL_JWT_SECRET='{"type":"HS256","key":"$(shell openssl rand -hex 32)"}' >> .env
echo JWT_SECRET=$(shell openssl rand -hex 32) >> .env

View file

@ -1,12 +1,12 @@
services:
db:
image: postgres:14-alpine
image: postgres:16-alpine
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- db_data:/var/lib/postgresql/data
hasura:
image: hasura/graphql-engine:v2.10.1.cli-migrations-v3
image: hasura/graphql-engine:v2.36.1-ce.cli-migrations-v3.ubi
depends_on: [db]
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres
@ -21,7 +21,7 @@ services:
ports:
- "8080:8080"
postgrest:
image: postgrest/postgrest:v10.0.0
image: postgrest/postgrest:v12.0.1
depends_on: [db]
environment:
PGRST_DB_URI: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1 @@
{}

View file

@ -4,13 +4,6 @@
connection_info:
database_url:
from_env: HASURA_GRAPHQL_DATABASE_URL
tables:
- table:
schema: public
name: users
insert_permissions:
- role: anonymous
permission:
check: {}
columns:
- name
isolation_level: read-committed
use_prepared_statements: false
tables: "!include default/tables/tables.yaml"

View file

@ -0,0 +1,9 @@
table:
name: users
schema: public
insert_permissions:
- role: anonymous
permission:
check: {}
columns:
- name

View file

@ -0,0 +1 @@
- "!include public_users.yaml"

View file

@ -0,0 +1 @@
disabled_for_roles: []

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1 @@
[]

View file

@ -1,5 +1,29 @@
# TypeScript で書いたサーバーをワンライナーで構築してみよう
tsx
```
npx tsx main.ts
```
tsx + watch
```
npx tsx --watch main.ts
```
esbuild (esbuild-register)
```
node -r esbuild-register main.ts
```
esbuild (esbuild-register) + watch
```
node -r esbuild-register --watch main.ts
```
tsup
```
@ -11,23 +35,3 @@ tsup + watch
```
npx tsup main.ts --clean --watch --onSuccess 'node dist/main.js'
```
ts-node
```
npx ts-node-transpile-only main.ts
```
ts-node + watch
n/a
esbuild (esbuild-register)
```
node -r esbuild-register main.ts
```
esbuild (esbuild-register) + watch
n/a

View file

@ -3,13 +3,13 @@
"version": "1.0.0",
"private": true,
"devDependencies": {
"@types/express": "^4.17.17",
"@types/node": "^20.3.1",
"esbuild": "^0.18.4",
"esbuild-register": "^3.4.2",
"@types/express": "^4.17.21",
"@types/node": "^20.10.5",
"esbuild": "^0.18.20",
"esbuild-register": "^3.5.0",
"express": "^4.18.2",
"ts-node": "^10.9.1",
"tsup": "^7.0.0",
"typescript": "^5.1.3"
"tsup": "^7.2.0",
"tsx": "^4.6.2",
"typescript": "^5.3.3"
}
}

560
ts/pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff