Test
All checks were successful
Build / build-backend (push) Successful in 3s
Build / build-web (push) Successful in 13s
Build / release (push) Successful in 5s

This commit is contained in:
2026-04-22 13:49:12 +02:00
parent 44fe3361a3
commit 152b541a6c
2 changed files with 18 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
export default defineEventHandler(async (event) => {
const config = useRuntimeConfig()
const direction = getRouterParam(event, 'direction')
if (direction !== 'forward' && direction !== 'backwards') {
throw createError({
statusCode: 400,
statusMessage: 'Invalid motor direction',
})
}
return await $fetch(`${config.quibotBaseUrl}/motor/step/${direction}`, {
method: 'POST',
query: {
token: config.quibotToken,
},
})
})