pankod / moleculerjs-boilerplate

A well-structured Moleculer JS Boilerplate with Typescript, CLI, Service Helpers, Swagger, Jest support and everything you'll ever need to deploy rock solid projects. https://pankod.github.io/moleculerjs-boilerplate/
MIT License
196 stars 36 forks source link

Get and Post specific actions #93

Open JamieJson opened 3 years ago

JamieJson commented 3 years ago

Hi,

Sorry I have a newbie question that I thought it's best to ask here. I'm not sure if there is a Gitter or a channel where there are molecular fans?

Question 1) when using molecular typescript or this boilerplate code, how would you restrict an action to only GET or post ?

Question 2) or even how would you have same endpoint with different verbs? GET /Defend
POST /Defend
UPDATE /Defend
DELETE /Defend

is this configured in the routes in the NAT or transporter? can we do it in the service itself ? (I can't see any option in the action decorator) image

https://github.com/pankod/moleculerjs-boilerplate/blob/2b7f4ee9959f6cfab9f0770fc5f5283af9694527/services/planet.service.ts#L32