Download server/src/controllers/hello.js from linuxrun/deer: direct link, hf CLI and curl.
- Browser
- Download file 378 Bytes
-
https://huggingface.co/spaces/linuxrun/deer/resolve/main/server/src/controllers/hello.js
- Command line
-
hf download hf://spaces/linuxrun/deer/server/src/controllers/hello.js
-
curl -L -o hello.js https://huggingface.co/spaces/linuxrun/deer/resolve/main/server/src/controllers/hello.js
378 Bytes
| import User from '../models/User'; | |
| export async function hello(req, res, next) { | |
| const user = await User.query().first(); | |
| if (user) { | |
| res.send('There is a user, account: ' + user.account); | |
| } else { | |
| const newUser = await User.query().insert({ | |
| account: 'account1', | |
| password: 'pass1', | |
| }); | |
| res.send('Inserted new user: ' + newUser.account); | |
| } | |
| } | |