mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-11 05:02:37 +01:00
29 lines
657 B
Plaintext
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"
|
|
},
|
|
} |