Add demo CAD kernel Controller, and typing to suit
We might be adding JSCAD soon and adding some guidance on the happy path with good typing for the CadKernels is a good idea related to #411
This commit is contained in:
32
app/web/src/helpers/cadPackages/demoController.ts
Normal file
32
app/web/src/helpers/cadPackages/demoController.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
// not an actual and there fore not imported into index.ts in this folder,
|
||||
// this is boiler plate code for adding new integrations.
|
||||
|
||||
import {
|
||||
RenderArgs,
|
||||
DefaultKernelExport,
|
||||
} from './common'
|
||||
|
||||
export const render: DefaultKernelExport['render'] = async ({
|
||||
code,
|
||||
settings,
|
||||
}: RenderArgs) => {
|
||||
// do your magic
|
||||
return {
|
||||
status: 'healthy',
|
||||
message: {
|
||||
type: 'message',
|
||||
message: 'demo',
|
||||
time: new Date()
|
||||
},
|
||||
objectData: {
|
||||
data: 'any',
|
||||
type: 'geometry'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const demoController: DefaultKernelExport = {
|
||||
render,
|
||||
}
|
||||
|
||||
export default demoController
|
||||
Reference in New Issue
Block a user