1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-30 22:08:02 +00:00

create hasura-rest

This commit is contained in:
Nebel 2021-10-16 02:12:59 +09:00
parent ca63a04f5c
commit b9f0551c86
12 changed files with 75 additions and 0 deletions

1
hasura-rest/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/.env

6
hasura-rest/config.yaml Normal file
View file

@ -0,0 +1,6 @@
version: 3
endpoint: http://localhost:8080
metadata_directory: metadata
actions:
kind: synchronous
handler_webhook_baseurl: http://localhost:3000

View file

@ -0,0 +1,34 @@
version: "3"
services:
db:
image: postgres:13.4
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- db_data:/var/lib/postgresql/data
hasura:
image: hasura/graphql-engine:v2.0.9.cli-migrations-v3
depends_on: [db]
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: anonymous
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET}
HASURA_GRAPHQL_JWT_SECRET: ${HASURA_GRAPHQL_JWT_SECRET}
volumes:
- ./migrations:/hasura-migrations
- ./metadata:/hasura-metadata
ports:
- "8080:8080"
postgrest:
image: postgrest/postgrest:v8.0.0
depends_on: [db]
environment:
PGRST_DB_URI: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres
PGRST_DB_SCHEMA: public
PGRST_DB_ANON_ROLE: anonymous
PGRST_JWT_SECRET: ${JWT_SECRET}
ports:
- "3000:3000"
volumes:
db_data:

View file

View file

@ -0,0 +1,6 @@
actions: []
custom_types:
enums: []
input_objects: []
objects: []
scalars: []

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1,16 @@
- name: default
kind: postgres
configuration:
connection_info:
database_url:
from_env: HASURA_GRAPHQL_DATABASE_URL
tables:
- table:
schema: public
name: users
insert_permissions:
- role: anonymous
permission:
check: {}
columns:
- name

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
version: 3

View file

@ -0,0 +1,7 @@
CREATE ROLE anonymous;
ALTER ROLE anonymous SET statement_timeout = '1s';
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name TEXT
);
GRANT INSERT (name) ON users TO anonymous;