mirror of
https://github.com/kou029w/_.git
synced 2025-02-03 15:48:40 +00:00
Compare commits
5 commits
2868954f46
...
c8edc8af7b
Author | SHA1 | Date | |
---|---|---|---|
|
c8edc8af7b | ||
4db8537fe4 | |||
f1780f541b | |||
87aeeafd13 | |||
4993bec7dc |
16 changed files with 320 additions and 342 deletions
7
hasura-rest/Makefile
Normal file
7
hasura-rest/Makefile
Normal 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
|
|
@ -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
|
||||
|
|
1
hasura-rest/metadata/api_limits.yaml
Normal file
1
hasura-rest/metadata/api_limits.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
1
hasura-rest/metadata/backend_configs.yaml
Normal file
1
hasura-rest/metadata/backend_configs.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -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"
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
table:
|
||||
name: users
|
||||
schema: public
|
||||
insert_permissions:
|
||||
- role: anonymous
|
||||
permission:
|
||||
check: {}
|
||||
columns:
|
||||
- name
|
|
@ -0,0 +1 @@
|
|||
- "!include public_users.yaml"
|
1
hasura-rest/metadata/graphql_schema_introspection.yaml
Normal file
1
hasura-rest/metadata/graphql_schema_introspection.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
disabled_for_roles: []
|
1
hasura-rest/metadata/inherited_roles.yaml
Normal file
1
hasura-rest/metadata/inherited_roles.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
[]
|
1
hasura-rest/metadata/metrics_config.yaml
Normal file
1
hasura-rest/metadata/metrics_config.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
1
hasura-rest/metadata/network.yaml
Normal file
1
hasura-rest/metadata/network.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
1
hasura-rest/metadata/opentelemetry.yaml
Normal file
1
hasura-rest/metadata/opentelemetry.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
1
hasura-rest/metadata/rest_endpoints.yaml
Normal file
1
hasura-rest/metadata/rest_endpoints.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
[]
|
44
ts/README.md
44
ts/README.md
|
@ -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
|
||||
|
|
|
@ -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
560
ts/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue