mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-22 11:07:57 +01:00
12 lines
496 B
JavaScript
12 lines
496 B
JavaScript
/* eslint-disable @typescript-eslint/no-var-requires, import/no-extraneous-dependencies */
|
|
const middleware = require('storybook-django/src/middleware');
|
|
|
|
// Target the Django server with IPV4 address explicitly to avoid DNS resolution of localhost to IPV6.
|
|
const origin = process.env.TEST_ORIGIN ?? 'http://127.0.0.1:8000';
|
|
|
|
module.exports = middleware.createDjangoAPIMiddleware({
|
|
origin,
|
|
// Must match the patterns in urls.py.
|
|
apiPath: ['/pattern-library/', '/static/wagtailadmin/'],
|
|
});
|