Avoid creating a variable.

This commit is contained in:
Jayden Seric 2020-07-23 00:16:12 +10:00
parent ead715ea92
commit 6e4a002e8c

View File

@ -63,7 +63,8 @@ const storeUpload = async (upload) => {
}; };
const app = new Koa(); const app = new Koa();
const server = new ApolloServer({
new ApolloServer({
uploads: { uploads: {
// Limits here should be stricter than config for surrounding // Limits here should be stricter than config for surrounding
// infrastructure such as Nginx so errors can be handled elegantly by // infrastructure such as Nginx so errors can be handled elegantly by
@ -74,9 +75,7 @@ const server = new ApolloServer({
}, },
schema, schema,
context: { db, storeUpload }, context: { db, storeUpload },
}); }).applyMiddleware({ app });
server.applyMiddleware({ app });
app.listen(process.env.PORT, (error) => { app.listen(process.env.PORT, (error) => {
if (error) throw error; if (error) throw error;