hasura graphql server (haskell)构建

安装 &&运行pg(docker)

version: '3.6'
services:
  postgres:
    image: postgres
    environment:
    - "POSTGRES_PASSWORD:dalong"
    restart: always
    ports:
    - "5432:5432"
    volumes:
    - db_data:/var/lib/postgresql/data
volumes:
  db_data:

安装satck haskell 构建工具

curl -sSL https://get.haskellstack.org/ | sh

构建

构建有点慢

cd graphql-engine/server
stack build --fast

运行

  • 启动pg
docker-compose up -d
  • 运行
stack exec graphql-engine -- --database-url=postgres://postgres:dalong@localhost:5432/postgres serve --enable-console
  • 效果



参考资料

https://github.com/hasura/graphql-engine/blob/master/server/CONTRIBUTING.md

猜你喜欢

转载自www.cnblogs.com/rongfengliang/p/9391429.html