Problem/Motivation

We need a mock JSON:API server, that can be used to serve a self-sufficient development and test environment for working with the front-end code. That way a development environment can be completely independent from a remote-hosted back-end sandbox.

Proposed resolution

A script could be added to the package.json file in the decoupled menu's project, which allows developers to run a simple Node/Express server locally. This local server should be strictly a development dependency and shouldn't be required for production.

https://www.npmjs.com/package/json-server is a popular solution that we could borrow ideas from, but it is worth noting that this solution may be a bit excessive and doesn't have innate support for JSON:API as far as I am aware.

Data Model

The data should be delivered via JSON:API, consistent with how a decoupled Drupal site would deliver the menu data. Additionally, it would be strongly preferred that the default data set be informed by the Umami demonstration: https://www.drupal.org/docs/umami-drupal-demonstration-installation-profile

Comments

lhockley created an issue. See original summary.

justafish’s picture

Assigned: Unassigned » justafish
deciphered’s picture

Fake JSON-api server (https://www.npmjs.com/package/fake-json-api-server) might be worth looking into, coupled with a structured directory of json files that are exported from a test instance of Drupal.