@@ -4,17 +4,17 @@ import { Pool } from 'mysql'
4
4
const register = (app: Express, pool: Pool) => {
5
5
<%
6
6
endpoints .forEach (function (endpoint ) {
7
- const path = endpoint .path ;
7
+ const path = endpoint .path
8
8
9
9
endpoint .methods .forEach (function (method ) {
10
10
if (! method .query ) {
11
11
// filter out aggregated_queries for a while (see #17)
12
12
return
13
13
}
14
- const hasGetOne = method .name === ' get' ;
15
- const hasGetMany = method .name === ' get_list' ;
16
- const sql = formatQuery (method .query );
17
- const params = extractParamsFromQuery (method .query );
14
+ const hasGetOne = method .name === ' get'
15
+ const hasGetMany = method .name === ' get_list'
16
+ const sql = formatQuery (method .query )
17
+ const params = extractParamsFromQuery (method .query )
18
18
const formattedParams = params .length > 0
19
19
? ' \n { ' + formatParamsAsJavaScriptObject (params) + ' },'
20
20
: ' '
@@ -87,13 +87,13 @@ endpoints.forEach(function(endpoint) {
87
87
})
88
88
< %
89
89
}
90
- });
91
- });
90
+ })
91
+ })
92
92
%>
93
93
app.use((error: any, req: Request, res: Response, next: NextFunction) => {
94
94
console.error(error)
95
95
res.status(500).json({ "error": "Internal Server Error" })
96
96
})
97
97
}
98
98
99
- exports.register = register;
99
+ exports.register = register
0 commit comments