-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/refactor server router #290
Conversation
…plit out more helpers in router into helpers.
@@ -1,422 +0,0 @@ | |||
// Copyright (c) 2017-2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file moved to server/router/index.js
@@ -0,0 +1,34 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/helpers into server/router/handlers
@@ -0,0 +1,37 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved helpers in
server/router.js
toserver/router/handlers
@@ -0,0 +1,46 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved helpers in
server/router.js
toserver/router/helpers
@@ -0,0 +1,45 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved helpers in
server/router.js
toserver/router/helpers
@@ -0,0 +1,33 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved helpers in
server/router.js
toserver/router/helpers
@@ -0,0 +1,136 @@ | |||
// Copyright (c) 2017-2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file moved from server/router.js
to server/router/index.js
workflowQueryTypeHandler, | ||
workflowSignalHandler, | ||
workflowTerminateHandler, | ||
} = require('./routes'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved
server/router.js
route handlers into separate files inserver/router/routes
@@ -0,0 +1,30 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,26 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,31 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,39 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -19,8 +19,6 @@ | |||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
// THE SOFTWARE. | |||
|
|||
const momentToLong = require('./moment-to-long'); | |||
const healthHandler = ctx => (ctx.body = 'OK'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think git diff messed up here. this is a new route handler.
@@ -0,0 +1,58 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,41 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,31 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,55 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,47 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,46 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,90 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,37 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,33 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,41 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,30 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,28 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
@@ -0,0 +1,28 @@ | |||
// Copyright (c) 2021 Uber Technologies Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved server/router.js
route handlers into separate files in server/router/routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the overall structure looks more clear now!
This PR has no functional change, only syntax / readability changes. The goal is to refactor Cadence UI server router so it has separate files for each route handler. This makes it easier to reason about what each handler is doing. Also each handler has no dependency on other handlers so there is no reason why they are in the same file. Because this PR is creating new files, majority of new lines are created from license headers per new file.
Changed
server/router.js
route handlers into separate files inserver/router/routes
server/helpers
intoserver/router/helpers
server/router.js
toserver/router/helpers