parent
256c732f8e
commit
e9b0a0339f
4 changed files with 63 additions and 12 deletions
@ -0,0 +1,22 @@ |
||||
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next'; |
||||
|
||||
const handleAPIFakeGetAllAnvil: NextApiHandler<AnvilList> = ( |
||||
request: NextApiRequest, |
||||
response: NextApiResponse<AnvilList>, |
||||
): void => { |
||||
response.send({ |
||||
anvils: [ |
||||
{ |
||||
uuid: '62ed925e-dddc-4541-acae-525fc99a9945', |
||||
}, |
||||
{ |
||||
uuid: '1040f37a-9847-4025-af2e-973b0f136979', |
||||
}, |
||||
{ |
||||
uuid: '52057dd0-04a6-4097-8a38-deb036116190', |
||||
}, |
||||
], |
||||
}); |
||||
}; |
||||
|
||||
export default handleAPIFakeGetAllAnvil; |
@ -0,0 +1,23 @@ |
||||
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next'; |
||||
|
||||
const handleAPIFakeGetOneAnvil: NextApiHandler<AnvilStatus> = ( |
||||
request: NextApiRequest, |
||||
response: NextApiResponse<AnvilStatus>, |
||||
): void => { |
||||
const generateNodeState: () => 0 | 1 = (): 0 | 1 => |
||||
Math.random() > 0.5 ? 1 : 0; |
||||
|
||||
response.send({ |
||||
nodes: [ |
||||
{ |
||||
on: generateNodeState(), |
||||
}, |
||||
{ |
||||
on: generateNodeState(), |
||||
}, |
||||
], |
||||
timestamp: Math.round(Date.now() / 1000), |
||||
}); |
||||
}; |
||||
|
||||
export default handleAPIFakeGetOneAnvil; |
Loading…
Reference in new issue