Skip to content
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

added multiple REST routes in service settings #214

Merged
merged 3 commits into from Nov 25, 2020
Merged

added multiple REST routes in service settings #214

merged 3 commits into from Nov 25, 2020

Conversation

mariusbackes
Copy link
Contributor

In my application I need the possibility to define several REST routes for a service. With this change it is possible to define an array of routes.

settings: {
  rest: ["/route", "/route/multi"]
},

actions: {
  test: {
    rest: "GET /test"
    ...
  }
}

Both routes /route/test and /route/multi/test call the specific action.

@coveralls
Copy link

coveralls commented Nov 20, 2020

Pull Request Test Coverage Report for Build 528

  • 56 of 57 (98.25%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 92.749%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/index.js 56 57 98.25%
Totals Coverage Status
Change from base Build 521: 0.2%
Covered Lines: 704
Relevant Lines: 727

💛 - Coveralls

@mariusbackes
Copy link
Contributor Author

mariusbackes commented Nov 23, 2020

The test run for Node 8 is not sucessful because jest has dropped the node 8 support with the major release of 26.0.0. #9423

@icebob
Copy link
Member

icebob commented Nov 23, 2020

Cool, thanks! By the way, would be useful supporting multi REST config in action schema as well.

actions: {
  test: {
    rest: ["GET /test", "POST /test2"]
    ...
  }
}

Maybe do you have time to work on as well in this PR?

@mariusbackes
Copy link
Contributor Author

I have added an array for each rest route. I have also updated the test cases

@icebob
Copy link
Member

icebob commented Nov 25, 2020

Awesome, thank, I will check it today.

Copy link
Member

@icebob icebob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! Thanks!

@icebob icebob merged commit c2949c2 into moleculerjs:master Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants