You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
44 lines
1.1 KiB
/* eslint-disable */
|
|
import {
|
|
createServer,
|
|
} from 'miragejs'
|
|
|
|
import {
|
|
ADS_API_URL,
|
|
APIS,
|
|
AUTH_SERVICE,
|
|
STATS_API_URL,
|
|
URL_AWS,
|
|
VIEWS_API,
|
|
} from 'config'
|
|
import { API_ROOT } from 'features/AuthServiceApp/config/routes'
|
|
|
|
import { surveys, getAds } from './fixtures'
|
|
import { models } from './models'
|
|
|
|
|
|
const mainDomain = 'insports.tv'
|
|
export function makeServer({ environment = 'test' } = {}) {
|
|
const server = createServer({
|
|
environment,
|
|
fixtures: {
|
|
surveys,
|
|
ads: getAds(),
|
|
},
|
|
models: models,
|
|
routes() {
|
|
this.passthrough(`${API_ROOT}/***`)
|
|
this.passthrough(`${VIEWS_API}/***`)
|
|
this.passthrough(`${STATS_API_URL}/***`)
|
|
this.passthrough(`${APIS.production.api}/***`)
|
|
this.passthrough(`${APIS.staging.api}/***`)
|
|
this.passthrough(`${AUTH_SERVICE}/***`)
|
|
this.passthrough(`https://${mainDomain}/***`)
|
|
this.passthrough(`https://images.${mainDomain}/***`)
|
|
this.passthrough(`${URL_AWS}/***`)
|
|
this.post(`${ADS_API_URL}`, getAds)
|
|
this.logging = true;
|
|
},
|
|
})
|
|
return server
|
|
}
|
|
|