2021-10-15 15:11:35 +02:00
|
|
|
{
|
|
|
|
"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", "});"],
|
2021-10-15 15:11:35 +02:00
|
|
|
"description": "An API endpoint"
|
2021-10-20 02:13:22 +02:00
|
|
|
}
|
|
|
|
}
|