mirror of
https://github.com/kou029w/_.git
synced 2025-02-03 23:58:44 +00:00
Compare commits
1 commit
a85a5b9124
...
18923fb3e6
Author | SHA1 | Date | |
---|---|---|---|
|
18923fb3e6 |
16 changed files with 342 additions and 320 deletions
|
@ -1,7 +0,0 @@
|
||||||
.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:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres:16-alpine
|
image: postgres:14-alpine
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- db_data:/var/lib/postgresql/data
|
- db_data:/var/lib/postgresql/data
|
||||||
hasura:
|
hasura:
|
||||||
image: hasura/graphql-engine:v2.36.1-ce.cli-migrations-v3.ubi
|
image: hasura/graphql-engine:v2.10.1.cli-migrations-v3
|
||||||
depends_on: [db]
|
depends_on: [db]
|
||||||
environment:
|
environment:
|
||||||
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres
|
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres
|
||||||
|
@ -21,7 +21,7 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
postgrest:
|
postgrest:
|
||||||
image: postgrest/postgrest:v12.0.1
|
image: postgrest/postgrest:v10.0.0
|
||||||
depends_on: [db]
|
depends_on: [db]
|
||||||
environment:
|
environment:
|
||||||
PGRST_DB_URI: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres
|
PGRST_DB_URI: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
{}
|
|
|
@ -1 +0,0 @@
|
||||||
{}
|
|
|
@ -4,6 +4,13 @@
|
||||||
connection_info:
|
connection_info:
|
||||||
database_url:
|
database_url:
|
||||||
from_env: HASURA_GRAPHQL_DATABASE_URL
|
from_env: HASURA_GRAPHQL_DATABASE_URL
|
||||||
isolation_level: read-committed
|
tables:
|
||||||
use_prepared_statements: false
|
- table:
|
||||||
tables: "!include default/tables/tables.yaml"
|
schema: public
|
||||||
|
name: users
|
||||||
|
insert_permissions:
|
||||||
|
- role: anonymous
|
||||||
|
permission:
|
||||||
|
check: {}
|
||||||
|
columns:
|
||||||
|
- name
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
table:
|
|
||||||
name: users
|
|
||||||
schema: public
|
|
||||||
insert_permissions:
|
|
||||||
- role: anonymous
|
|
||||||
permission:
|
|
||||||
check: {}
|
|
||||||
columns:
|
|
||||||
- name
|
|
|
@ -1 +0,0 @@
|
||||||
- "!include public_users.yaml"
|
|
|
@ -1 +0,0 @@
|
||||||
disabled_for_roles: []
|
|
|
@ -1 +0,0 @@
|
||||||
[]
|
|
|
@ -1 +0,0 @@
|
||||||
{}
|
|
|
@ -1 +0,0 @@
|
||||||
{}
|
|
|
@ -1 +0,0 @@
|
||||||
{}
|
|
|
@ -1 +0,0 @@
|
||||||
[]
|
|
44
ts/README.md
44
ts/README.md
|
@ -1,29 +1,5 @@
|
||||||
# TypeScript で書いたサーバーをワンライナーで構築してみよう
|
# 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
|
tsup
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -35,3 +11,23 @@ tsup + watch
|
||||||
```
|
```
|
||||||
npx tsup main.ts --clean --watch --onSuccess 'node dist/main.js'
|
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",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/express": "^4.17.21",
|
"@types/express": "^4.17.17",
|
||||||
"@types/node": "^20.10.5",
|
"@types/node": "^20.3.1",
|
||||||
"esbuild": "^0.18.20",
|
"esbuild": "^0.18.4",
|
||||||
"esbuild-register": "^3.5.0",
|
"esbuild-register": "^3.4.2",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"tsup": "^7.2.0",
|
"ts-node": "^10.9.1",
|
||||||
"tsx": "^4.6.2",
|
"tsup": "^7.0.0",
|
||||||
"typescript": "^5.3.3"
|
"typescript": "^5.1.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