middleware.js 405 B

12345678910
  1. const middleware = require('storybook-django/src/middleware');
  2. // Target the Django server with IPV4 address explicitly to avoid DNS resolution of localhost to IPV6.
  3. const origin = process.env.TEST_ORIGIN ?? 'http://127.0.0.1:8000';
  4. module.exports = middleware.createDjangoAPIMiddleware({
  5. origin,
  6. // Must match the patterns in urls.py.
  7. apiPath: ['/pattern-library/', '/static/wagtailadmin/'],
  8. });