Skip to content

Commit 654bc40

Browse files
committed
stuff
1 parent 12296b8 commit 654bc40

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/api/index.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ async function init(prettyPrint: boolean = false, initClients: boolean = true) {
100100
return event.requestContext.requestId;
101101
},
102102
});
103+
if (!process.env.RunEnvironment) {
104+
process.env.RunEnvironment = "dev";
105+
}
106+
app.runEnvironment = process.env.RunEnvironment as RunEnvironment;
107+
app.environmentConfig =
108+
environmentConfig[app.runEnvironment as RunEnvironment];
103109
app.setValidatorCompiler(validatorCompiler);
104110
app.setSerializerCompiler(serializerCompiler);
105111

@@ -111,8 +117,9 @@ async function init(prettyPrint: boolean = false, initClients: boolean = true) {
111117
openapi: {
112118
info: {
113119
title: "ACM @ UIUC Core API",
114-
description: "ACM @ UIUC Core Management Platform",
115-
version: "1.0.0",
120+
description:
121+
"The ACM @ UIUC Core API provides services for managing chapter operations.",
122+
version: "1.1.0",
116123
contact: {
117124
name: "ACM @ UIUC Infrastructure Team",
118125
@@ -127,12 +134,8 @@ async function init(prettyPrint: boolean = false, initClients: boolean = true) {
127134
},
128135
servers: [
129136
{
130-
url: "https://core.acm.illinois.edu",
131-
description: "Production API server",
132-
},
133-
{
134-
url: "https://core.aws.qa.acmuiuc.org",
135-
description: "QA API server",
137+
url: app.environmentConfig.UserFacingUrl,
138+
description: "Main API server",
136139
},
137140
],
138141

@@ -215,6 +218,7 @@ async function init(prettyPrint: boolean = false, initClients: boolean = true) {
215218
});
216219
isSwaggerServer = true;
217220
} catch (e) {
221+
app.log.error(e);
218222
app.log.warn("Fastify Swagger not created!");
219223
}
220224
}
@@ -229,9 +233,6 @@ async function init(prettyPrint: boolean = false, initClients: boolean = true) {
229233
root: path.join(__dirname, "public"),
230234
prefix: "/",
231235
});
232-
if (!process.env.RunEnvironment) {
233-
process.env.RunEnvironment = "dev";
234-
}
235236
if (isRunningInLambda && !isSwaggerServer) {
236237
// Serve docs from S3
237238
app.get("/api/documentation", (_request, response) => {
@@ -264,9 +265,6 @@ async function init(prettyPrint: boolean = false, initClients: boolean = true) {
264265
"Audit logging to Dynamo is disabled! Audit log statements will be logged to the console.",
265266
);
266267
}
267-
app.runEnvironment = process.env.RunEnvironment as RunEnvironment;
268-
app.environmentConfig =
269-
environmentConfig[app.runEnvironment as RunEnvironment];
270268
app.nodeCache = new NodeCache({ checkperiod: 30 });
271269
if (initClients) {
272270
app.dynamoClient = new DynamoDBClient({

0 commit comments

Comments
 (0)