1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-06 19:02:33 +01:00
server/api/.vscode/api-snippets.code-snippets

26 lines
644 B
Plaintext
Raw Normal View History

{
"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",
2021-10-20 02:13:22 +02:00
"body": ["router.get(\"$1\", route({}), (req: Request, res: Response) => {", "\t$2", "});"],
"description": "An API endpoint"
2021-10-20 02:13:22 +02:00
}
}