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.
24 lines
542 B
24 lines
542 B
4 years ago
|
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;
|