From 49edcf00c2ef5d59a7a4d26277594e7cc92929de Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 23 Dec 2022 16:51:25 +0800 Subject: Develop secret api. v62 --- .../CrupestApi.Todos/TodosServiceCollectionExtensions.cs | 2 +- docker/crupest-api/CrupestApi/CrupestApi/Program.cs | 2 ++ docker/crupest-nginx/sites/www/index.html | 8 +++++++- docker/crupest-nginx/sites/www/secrets.html | 16 ++++++++++++++++ docker/crupest-nginx/sites/www/vite.config.js | 6 ++++++ 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 docker/crupest-nginx/sites/www/secrets.html (limited to 'docker') diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Todos/TodosServiceCollectionExtensions.cs b/docker/crupest-api/CrupestApi/CrupestApi.Todos/TodosServiceCollectionExtensions.cs index 5041094..a49d55d 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi.Todos/TodosServiceCollectionExtensions.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi.Todos/TodosServiceCollectionExtensions.cs @@ -6,7 +6,7 @@ public static class TodosServiceCollectionExtensions { public static IServiceCollection AddTodos(this IServiceCollection services) { - services.AddOptions().BindConfiguration("CrupestApi.Todos"); + services.AddOptions().BindConfiguration("CrupestApi:Todos"); services.PostConfigure(config => { if (config.Count == 0) diff --git a/docker/crupest-api/CrupestApi/CrupestApi/Program.cs b/docker/crupest-api/CrupestApi/CrupestApi/Program.cs index cafed44..8c8cd41 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi/Program.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi/Program.cs @@ -1,4 +1,5 @@ using CrupestApi.Commons; +using CrupestApi.Commons.Crud; using CrupestApi.Secrets; using CrupestApi.Todos; @@ -15,6 +16,7 @@ builder.Services.AddSecrets(); var app = builder.Build(); +app.UseCrudCore(); app.MapTodos("/api/todos"); app.MapSecrets("/api/secrets"); diff --git a/docker/crupest-nginx/sites/www/index.html b/docker/crupest-nginx/sites/www/index.html index 9eaeace..9e15080 100644 --- a/docker/crupest-nginx/sites/www/index.html +++ b/docker/crupest-nginx/sites/www/index.html @@ -22,9 +22,14 @@ href="https://github.com/crupest">https://github.com/crupest .

Currently this page is hosted on my own server and my own apex domain (crupest.life). You can also share this website link, aka, https://crupest.life .

-

This is just the home page. I also run some other services on my server and under this domain's subdomain:

+

This is just the home page. I also run some other services on my server and under this domain:

Public:

If you wish to deploy similar services like mine, you are in the right place. Take a look at https://github.com/crupest/crupest and there is diff --git a/docker/crupest-nginx/sites/www/secrets.html b/docker/crupest-nginx/sites/www/secrets.html new file mode 100644 index 0000000..57f5b0d --- /dev/null +++ b/docker/crupest-nginx/sites/www/secrets.html @@ -0,0 +1,16 @@ + + + + + + + + + crupest secrets management + + + + Hello world! + + + \ No newline at end of file diff --git a/docker/crupest-nginx/sites/www/vite.config.js b/docker/crupest-nginx/sites/www/vite.config.js index f7f6c8a..a30c7ea 100644 --- a/docker/crupest-nginx/sites/www/vite.config.js +++ b/docker/crupest-nginx/sites/www/vite.config.js @@ -6,5 +6,11 @@ export default { server: { port: 6123, strictPort: true, + proxy: { + "/api": { + target: "http://localhost:5188", + changeOrigin: true, + }, + }, }, }; -- cgit v1.2.3