helsingborg-stad/gdi-modularity-cases

GDI 案例模块

1.0.5 2024-09-10 11:35 UTC

This package is auto-updated.

Last update: 2024-09-10 11:35:31 UTC


README

模块化模块,允许认证用户管理案例列表、分组和筛选。这是一个作为模块化模块封装在Wordpress插件中的React应用程序。

入门指南

# clone repo into wp-content/plugins folder
git clone https://github.com/helsingborg-stad/gdi-modularity-cases.git

# install composer dependencies
composer install

# install npm dependencies
yarn

# build scripts
yarn build

# watch scripts (for development)
yarn watch

# activate wordpress plugin (using wp-cli)
wp plugin activate gdi-modularity-cases --url=example.local

# configure graphql endpoint (using wp-cli)
wp option update options_cases_api_uri http://localhost:3000/api/v1/aboutme/graphql --url=example.local

入门指南(无Wordpress的Headless模式)

此插件可以在不使用Wordpress的情况下运行(用于开发)。

# install dependencies
yarn

# copy example env 
cp .env.example .env

# start web server
yarn start

外部连接和模拟数据

在开发期间,在.env中配置了GraphQL端点(指向GDI About Me服务器)。

# Serve graphql from real endpoint
ABOUTME_GRAPHQL_URI=https://mycompany/api/v1/aboutme/graphql
# Serve graphql from file in ./dev-static
ABOUTME_GRAPHQL_URI=/dev-static/sample-aboutme-graphql-response.json

此插件向正在运行的GDI About Me服务器发送GraphQL查询。