deemix-gui/server/src/routes/api/get/mainSearch.ts

14 lines
357 B
TypeScript
Raw Normal View History

2021-04-22 08:32:41 +00:00
import { ApiHandler } from '../../../types'
import { searchAll } from '../../../main'
const path: ApiHandler['path'] = '/mainSearch'
const handler: ApiHandler['handler'] = async (req, res) => {
const searchData = await searchAll(String(req.query.term))
res.send(searchData)
}
const apiHandler: ApiHandler = { path, handler }
export default apiHandler