Download source/examPlugin.js from FormaLau/microduck-reachy-simulator: direct link, hf CLI and curl.
- Browser
- Download file 422 Bytes
-
https://huggingface.co/spaces/FormaLau/microduck-reachy-simulator/resolve/main/source/examPlugin.js
- Command line
-
hf download hf://spaces/FormaLau/microduck-reachy-simulator/source/examPlugin.js
-
curl -L -o examPlugin.js https://huggingface.co/spaces/FormaLau/microduck-reachy-simulator/resolve/main/source/examPlugin.js
422 Bytes
| import { loadEnv } from 'vite'; | |
| import { createExamHandler } from './server/exam.mjs'; | |
| export function examPlugin() { | |
| let env; | |
| const install = server => { server.middlewares.use(createExamHandler({ env })); }; | |
| return { | |
| name: 'exam-api', | |
| configResolved(config) { env = { ...loadEnv(config.mode, config.root, ''), ...process.env }; }, | |
| configureServer: install, | |
| configurePreviewServer: install, | |
| }; | |
| } | |