Download src/api/routes/token.ts from alcex/duck2api: direct link, hf CLI and curl.
- Browser
- Download file 534 Bytes
-
https://huggingface.co/spaces/alcex/duck2api/resolve/main/src/api/routes/token.ts
- Command line
-
hf download hf://spaces/alcex/duck2api/src/api/routes/token.ts
-
curl -L -o token.ts https://huggingface.co/spaces/alcex/duck2api/resolve/main/src/api/routes/token.ts
534 Bytes
| import _ from 'lodash'; | |
| import Request from '@/lib/request/Request.ts'; | |
| import Response from '@/lib/response/Response.ts'; | |
| import chat from '@/api/controllers/chat.ts'; | |
| import logger from '@/lib/logger.ts'; | |
| export default { | |
| prefix: '/token', | |
| post: { | |
| '/check': async (request: Request) => { | |
| request | |
| .validate('body.token', _.isString) | |
| const live = await chat.getTokenLiveStatus(request.body.token); | |
| return { | |
| live | |
| } | |
| } | |
| } | |
| } |