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

add http API interface #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add http API interface #110

wants to merge 1 commit into from

Conversation

wlclass
Copy link

@wlclass wlclass commented Jan 3, 2023

Added an http api to the project to manage the template's three interfaces:

POST or GET: /{Endpoint}/list

POST: /{Endpoint}/remove

POST: /{Endpoint}/update

The Endpoint can be configured in MockacoOptions, and a simple authentication is added for the api interface, which requires a security key to be provided through the token query parameter.

This is a sloppy pr, but hopefully it will help.

Associated issue: #66 #102

@wlclass
Copy link
Author

wlclass commented Jan 6, 2023

@natenho Do you have any ideas?

@natenho
Copy link
Owner

natenho commented Jan 12, 2023

Hi @wlclass, I'm going to review as soon as possible and we can discuss about it! Thank you for your contribution!!

Copy link
Owner

@natenho natenho left a comment

Choose a reason for hiding this comment

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

Hi @wlclass, would you mind to update README file with this feature?

@@ -13,6 +14,8 @@ public static IApplicationBuilder UseMockaco(this IApplicationBuilder app, Actio
var options = app.ApplicationServices.GetRequiredService<IOptions<MockacoOptions>>().Value;
app.UseEndpoints(endpoints => endpoints.Map($"/{options.VerificationEndpointPrefix}/{options.VerificationEndpointName}", VerifyerExtensions.Verify));

app.UseEndpoints(endpoints => endpoints.Map($"/{options.AdminApiEndpointPrefix}/{options.AdminApiEndpointName}/{{action}}", AdminApiExtensions.Handler));
Copy link
Owner

Choose a reason for hiding this comment

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

Have you considered using restful actions? i.e. use HTTP verbs to represent actions

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

2 participants