Download api/src/index.ts from Jessedbrown/warran: direct link, hf CLI and curl.
- Browser
- Download file 635 Bytes
-
https://huggingface.co/Jessedbrown/warran/resolve/main/api/src/index.ts
- Command line
-
hf download hf://Jessedbrown/warran/api/src/index.ts
-
curl -L -o index.ts https://huggingface.co/Jessedbrown/warran/resolve/main/api/src/index.ts
635 Bytes
| import { AddressInfo } from "net"; | |
| import dotenv from 'dotenv'; | |
| import express from "express"; | |
| import cors from "cors" | |
| import { userRouter } from './router/userRouter' | |
| import { walletRouter } from './router/walletRouter' | |
| dotenv.config(); | |
| const app = express(); | |
| app.use(cors({ origin: true })); | |
| app.use(express.json()); | |
| app.use("/user", userRouter); | |
| app.use("/wallet", walletRouter); | |
| export const server = app.listen(3000, () => { | |
| if (server) { | |
| const address = server.address() as AddressInfo; | |
| console.log(`Server running: http://localhost:${address.port}`); | |
| } else { | |
| console.error(`Server running failed`); | |
| } | |
| }); | |