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.
31 lines
862 B
31 lines
862 B
/* eslint-disable */
|
|
import {
|
|
createServer,
|
|
Model,
|
|
} from 'miragejs'
|
|
|
|
import { ResponseType } from 'requests/getFavouriteTeam'
|
|
|
|
import { surveys } from './Fixtures/surveys'
|
|
|
|
export function makeServer({ environment = 'test' } = {}) {
|
|
const server = createServer({
|
|
environment,
|
|
factories: {},
|
|
fixtures: {
|
|
surveys,
|
|
},
|
|
models: {
|
|
surveys: Model.extend<Partial<ResponseType>>({}),
|
|
},
|
|
routes() {
|
|
this.passthrough('https://api.insports.tv/***')
|
|
this.passthrough('https://insports.tv/***')
|
|
this.passthrough('https://images.insports.tv/***')
|
|
this.passthrough('https://auth.insports.tv/***')
|
|
this.passthrough('https://cf-aws.insports.tv/***')
|
|
this.get('https://api.insports.tv/v1/survey/teams/1/131/30', (schema: any) => schema.all('surveys').models[0].attrs)
|
|
},
|
|
})
|
|
return server
|
|
}
|
|
|