Skip to content

Commit

Permalink
fix deployment for websocket server
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianP8701 committed Sep 28, 2024
1 parent 5d6d871 commit a08313b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
7 changes: 7 additions & 0 deletions journal.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# September 28th 2024
Okay since my last journal entry, I've made a few changes to the codebase. We now use typescript end to end, have cloud infra, ci/cd and other shit. In terms of implementing the actual system, no progress has been made. Now we have the infra and dev experience out of the way we can begin getting started. Let's make a roadmap:
- [ ] Allow users to arrange the UIs DialogPreview components however they like
- [ ] Convert nodes to use mappings to support graphs
- [ ] Make two modes for displaying nodes: Basic and Card
- [ ]

# July 21th 2024
Well. This is awkward. We have to revert back to the original design of seemingly excessive blocking operations. This is because it allows easy exit and reentry points. Without seemingly excessive blocking operations we have, well less operations. I also thought it would allow the action code to become more concise. But question wrappers need to return it's operations directly back to the source. This basically means we want functions that directly return Operations. This brings back the question of how do we pass args between these functions.

Expand Down
24 changes: 12 additions & 12 deletions server/src/websocket-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ const startServer = async () => {

const {serverCleanup } = createApolloWsServer(httpServer, container)

apolloServer.addPlugin({
async serverWillStart() {
return {
async drainServer() {
await serverCleanup.dispose()
},
}
},
})

await apolloServer.start()

app.use(
'/graphql',
cors<cors.CorsRequest>({ origin: CORS_WHITELIST, credentials: true }),
Expand All @@ -58,18 +70,6 @@ const startServer = async () => {
})
)

apolloServer.addPlugin({
async serverWillStart() {
return {
async drainServer() {
await serverCleanup.dispose()
},
}
},
})

await apolloServer.start()

httpServer.listen(PORT, () => {
logger.info(`Server is now running on http://localhost:${PORT}/graphql`)
})
Expand Down

0 comments on commit a08313b

Please sign in to comment.