1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 13:14:06 +01:00
server/api/.vscode/api-snippets.code-snippets
2021-10-15 13:11:35 +00:00

29 lines
657 B
Plaintext

{
"API Router": {
"scope": "javascript,typescript",
"prefix": "router",
"body": [
"import { Router, Response, Request } from \"express\";",
"import { route } from \"@fosscord/api\";",
"",
"const router = Router();",
"",
"router.get(\"/\", route({}), (req: Request, res: Response) => {",
"\tres.json({});",
"});",
"",
"export default router;"
],
"description": "A basic API router setup for a blank route."
},
"Route": {
"scope": "typescript",
"prefix": "route",
"body": [
"router.get(\"$1\", route({}), (req: Request, res: Response) => {",
"\t$2",
"});"
],
"description": "An API endpoint"
},
}