diff options
-rw-r--r-- | api/.vscode/api-snippets.code-snippets | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/api/.vscode/api-snippets.code-snippets b/api/.vscode/api-snippets.code-snippets new file mode 100644 index 00000000..17bde62f --- /dev/null +++ b/api/.vscode/api-snippets.code-snippets @@ -0,0 +1,29 @@ +{ + "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" + }, +} \ No newline at end of file |