-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
46 lines (38 loc) · 1.11 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* config.js is the configuration exported as `config`
*/
const path = require("path");
module.exports = (params) => {
// Spec Defaults
const spec = {
endpoint: "/api",
servicesDir: path.join(process.cwd(), "/api-services"),
schemasDir: path.join(process.cwd(), "/api-schemas"),
schemasURI: "https://example.com/schemas",
defaultErrors: [
"OK",
"NotImplemented",
"NotFound",
"InvalidParameters",
],
authErrors: {
authentication: "AuthenticationRequired",
authorization: "AuthorizationRequired",
},
};
// Client Defaults
const client = {
languageAndFramework: "javascript-axios-ts",
outputDir: path.join(process.cwd(), "/generated-client"),
};
// Server Defaults
const server = {
languageAndFramework: "javascript-express-ts", // empty string means no server
outputDir: path.join(process.cwd(), "/generated-server"),
};
return {
spec,
client,
server,
};
};