Download server/src/controllers/file.js from linuxrun/deer: direct link, hf CLI and curl.
- Browser
- Download file 401 Bytes
-
https://huggingface.co/spaces/linuxrun/deer/resolve/ba89fcbd4ce8c877fd4fcffd6ecd14cddf11e110/server/src/controllers/file.js
- Command line
-
hf download hf://spaces/linuxrun/deer@ba89fcbd4ce8c877fd4fcffd6ecd14cddf11e110/server/src/controllers/file.js
-
curl -L -o file.js https://huggingface.co/spaces/linuxrun/deer/resolve/ba89fcbd4ce8c877fd4fcffd6ecd14cddf11e110/server/src/controllers/file.js
401 Bytes
| import moment from 'moment'; | |
| import { | |
| getRandomString, | |
| formatDatetimeForMySQL, | |
| } from '../common/util'; | |
| import FileCode from '../models/FileCode'; | |
| export async function getCode(req, res, next) { | |
| const code = getRandomString(8); | |
| const expiredAt = formatDatetimeForMySQL(moment().add(1, 'days')); | |
| await FileCode.query().insert({ | |
| code, | |
| expiredAt, | |
| }); | |
| res.json({ | |
| code, | |
| }); | |
| } | |