mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-06 10:52:31 +01:00
26 lines
644 B
Plaintext
26 lines
644 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"
|
|
}
|
|
}
|