{"id":1182,"date":"2025-10-09T07:17:42","date_gmt":"2025-10-09T00:17:42","guid":{"rendered":"https:\/\/portal-atlasx.cdg.co.th\/home\/docs\/atlasx-web-service-v8-0\/fundamentals\/app-structure\/"},"modified":"2026-03-27T08:37:20","modified_gmt":"2026-03-27T01:37:20","slug":"app-structure","status":"publish","type":"docs","link":"https:\/\/portal-atlasx.cdg.co.th\/home\/docs\/axws\/fundamentals\/app-structure\/","title":{"rendered":"App structure"},"content":{"rendered":"\n\n\n<p>AtlasX Web Service \u0e41\u0e1a\u0e48\u0e07\u0e42\u0e04\u0e23\u0e07\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e2d\u0e2d\u0e01\u0e40\u0e1b\u0e47\u0e19\u0e2b\u0e25\u0e32\u0e22 project \u0e15\u0e32\u0e21 responsibility \u0e42\u0e14\u0e22\u0e41\u0e15\u0e48\u0e25\u0e30 project \u0e17\u0e33\u0e2b\u0e19\u0e49\u0e32\u0e17\u0e35\u0e48\u0e41\u0e15\u0e01\u0e15\u0e48\u0e32\u0e07\u0e01\u0e31\u0e19 \u0e41\u0e25\u0e30\u0e43\u0e0a\u0e49&nbsp;<code>Shared<\/code>&nbsp;\u0e40\u0e1b\u0e47\u0e19 library \u0e01\u0e25\u0e32\u0e07\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a feature \u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e23\u0e48\u0e27\u0e21\u0e01\u0e31\u0e19<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#adbac7;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>AtlasX.Web.Service\/\n\u251c\u2500\u2500 Atlasx.Administrative\/     # \u0e08\u0e31\u0e14\u0e01\u0e32\u0e23 back-office \u0e41\u0e25\u0e30 admin features\n\u251c\u2500\u2500 Atlasx.Gateway\/            # API Gateway \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a routing \u0e41\u0e25\u0e30 middleware\n\u251c\u2500\u2500 Atlasx.Identity\/           # Authentication \u0e41\u0e25\u0e30 OAuth 2.0\n\u251c\u2500\u2500 Shared\/                    # Library \u0e01\u0e25\u0e32\u0e07\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e23\u0e48\u0e27\u0e21\u0e01\u0e31\u0e19\u0e17\u0e38\u0e01 project\n\u251c\u2500\u2500 .env.example               # \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c environment variables\n\u251c\u2500\u2500 .gitignore                 # \u0e01\u0e33\u0e2b\u0e19\u0e14\u0e44\u0e1f\u0e25\u0e4c\u0e17\u0e35\u0e48\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07 commit \u0e40\u0e02\u0e49\u0e32 Git\n\u251c\u2500\u2500 AtlasX.Web.Service.slnx    # Solution file\n\u251c\u2500\u2500 Directory.Build.props      # \u0e01\u0e33\u0e2b\u0e19\u0e14 properties \u0e23\u0e48\u0e27\u0e21\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e17\u0e38\u0e01 project\n\u251c\u2500\u2500 global.json                # \u0e01\u0e33\u0e2b\u0e19\u0e14 .NET SDK version\n\u251c\u2500\u2500 nuget.config               # \u0e01\u0e33\u0e2b\u0e19\u0e14 NuGet package sources\n\u2514\u2500\u2500 nuget.config.template      # template \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a nuget.config<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark-dimmed\" style=\"background-color: #22272e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F69D50\">AtlasX.Web.Service\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F69D50\">\u251c\u2500\u2500<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">Atlasx.Administrative\/<\/span><span style=\"color: #ADBAC7\">     <\/span><span style=\"color: #768390\"># \u0e08\u0e31\u0e14\u0e01\u0e32\u0e23 back-office \u0e41\u0e25\u0e30 admin features<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F69D50\">\u251c\u2500\u2500<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">Atlasx.Gateway\/<\/span><span style=\"color: #ADBAC7\">            <\/span><span style=\"color: #768390\"># API Gateway \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a routing \u0e41\u0e25\u0e30 middleware<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F69D50\">\u251c\u2500\u2500<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">Atlasx.Identity\/<\/span><span style=\"color: #ADBAC7\">           <\/span><span style=\"color: #768390\"># Authentication \u0e41\u0e25\u0e30 OAuth 2.0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F69D50\">\u251c\u2500\u2500<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">Shared\/<\/span><span style=\"color: #ADBAC7\">                    <\/span><span style=\"color: #768390\"># Library \u0e01\u0e25\u0e32\u0e07\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e23\u0e48\u0e27\u0e21\u0e01\u0e31\u0e19\u0e17\u0e38\u0e01 project<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F69D50\">\u251c\u2500\u2500<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">.env.example<\/span><span style=\"color: #ADBAC7\">               <\/span><span style=\"color: #768390\"># \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c environment variables<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F69D50\">\u251c\u2500\u2500<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">.gitignore<\/span><span style=\"color: #ADBAC7\">                 <\/span><span style=\"color: #768390\"># \u0e01\u0e33\u0e2b\u0e19\u0e14\u0e44\u0e1f\u0e25\u0e4c\u0e17\u0e35\u0e48\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07 commit \u0e40\u0e02\u0e49\u0e32 Git<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F69D50\">\u251c\u2500\u2500<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">AtlasX.Web.Service.slnx<\/span><span style=\"color: #ADBAC7\">    <\/span><span style=\"color: #768390\"># Solution file<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F69D50\">\u251c\u2500\u2500<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">Directory.Build.props<\/span><span style=\"color: #ADBAC7\">      <\/span><span style=\"color: #768390\"># \u0e01\u0e33\u0e2b\u0e19\u0e14 properties \u0e23\u0e48\u0e27\u0e21\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e17\u0e38\u0e01 project<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F69D50\">\u251c\u2500\u2500<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">global.json<\/span><span style=\"color: #ADBAC7\">                <\/span><span style=\"color: #768390\"># \u0e01\u0e33\u0e2b\u0e19\u0e14 .NET SDK version<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F69D50\">\u251c\u2500\u2500<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">nuget.config<\/span><span style=\"color: #ADBAC7\">               <\/span><span style=\"color: #768390\"># \u0e01\u0e33\u0e2b\u0e19\u0e14 NuGet package sources<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F69D50\">\u2514\u2500\u2500<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">nuget.config.template<\/span><span style=\"color: #ADBAC7\">      <\/span><span style=\"color: #768390\"># template \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a nuget.config<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Projects<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Project<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td><code>Atlasx.Administrative<\/code><\/td><td>\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23 backoffice features \u0e40\u0e0a\u0e48\u0e19 \u0e01\u0e32\u0e23\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23 user, role \u0e41\u0e25\u0e30 permission<\/td><\/tr><tr><td><code>Atlasx.Gateway<\/code><\/td><td>\u0e17\u0e33\u0e2b\u0e19\u0e49\u0e32\u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19 API Gateway \u0e23\u0e31\u0e1a request \u0e08\u0e32\u0e01 client \u0e41\u0e25\u0e30 route \u0e44\u0e1b\u0e22\u0e31\u0e07 service \u0e17\u0e35\u0e48\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e02\u0e49\u0e2d\u0e07<\/td><\/tr><tr><td><code>Atlasx.Identity<\/code><\/td><td>\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23 authentication \u0e41\u0e25\u0e30 OAuth 2.0 \u0e04\u0e23\u0e2d\u0e1a\u0e04\u0e25\u0e38\u0e21 login, token \u0e41\u0e25\u0e30 session<\/td><\/tr><tr><td><code>Shared<\/code><\/td><td>Library \u0e01\u0e25\u0e32\u0e07\u0e17\u0e35\u0e48\u0e23\u0e27\u0e21 feature \u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e23\u0e48\u0e27\u0e21\u0e01\u0e31\u0e19 \u0e40\u0e0a\u0e48\u0e19 DataAccess, Auth, Mail, Report, Session<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Root Files<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>\u0e44\u0e1f\u0e25\u0e4c<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td><code>.env.example<\/code><\/td><td>\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07 environment variables \u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\u0e17\u0e35\u0e48\u0e08\u0e33\u0e40\u0e1b\u0e47\u0e19 \u0e43\u0e2b\u0e49 copy \u0e40\u0e1b\u0e47\u0e19&nbsp;<code>.env<\/code>&nbsp;\u0e41\u0e25\u0e49\u0e27\u0e41\u0e01\u0e49\u0e04\u0e48\u0e32\u0e01\u0e48\u0e2d\u0e19\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19<\/td><\/tr><tr><td><code>.gitignore<\/code><\/td><td>\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e44\u0e1f\u0e25\u0e4c\u0e17\u0e35\u0e48\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07 commit \u0e40\u0e02\u0e49\u0e32 Git \u0e40\u0e0a\u0e48\u0e19&nbsp;<code>.env<\/code>, build output<\/td><\/tr><tr><td><code>AtlasX.Web.Service.slnx<\/code><\/td><td>Solution file \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e40\u0e1b\u0e34\u0e14\u0e17\u0e38\u0e01 project \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e01\u0e31\u0e19\u0e43\u0e19 Visual Studio \u0e2b\u0e23\u0e37\u0e2d Rider<\/td><\/tr><tr><td><code>Directory.Build.props<\/code><\/td><td>\u0e01\u0e33\u0e2b\u0e19\u0e14 properties \u0e23\u0e48\u0e27\u0e21\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e17\u0e38\u0e01 project \u0e40\u0e0a\u0e48\u0e19 target framework \u0e41\u0e25\u0e30 package versions<\/td><\/tr><tr><td><code>global.json<\/code><\/td><td>\u0e01\u0e33\u0e2b\u0e19\u0e14 .NET SDK version \u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e43\u0e19 solution<\/td><\/tr><tr><td><code>nuget.config<\/code><\/td><td>\u0e01\u0e33\u0e2b\u0e19\u0e14 NuGet package sources \u0e23\u0e27\u0e21\u0e16\u0e36\u0e07 internal feed \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a AtlasX packages<\/td><\/tr><tr><td><code>nuget.config.template<\/code><\/td><td>template \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e2a\u0e23\u0e49\u0e32\u0e07&nbsp;<code>nuget.config<\/code>&nbsp;\u0e40\u0e2b\u0e21\u0e32\u0e30\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a setup \u0e04\u0e23\u0e31\u0e49\u0e07\u0e41\u0e23\u0e01<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Getting Started<\/strong><\/h2>\n\n\n\n<p>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07 AtlasX Web Service<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>1. \u0e2a\u0e23\u0e49\u0e32\u0e07 Project<\/strong><\/h4>\n\n\n\n<p>\u0e43\u0e0a\u0e49&nbsp;<code>dotnet new axws<\/code>&nbsp;template \u0e2a\u0e23\u0e49\u0e32\u0e07 project \u0e15\u0e32\u0e21\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23 \u0e14\u0e39\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21\u0e44\u0e14\u0e49\u0e17\u0e35\u0e48&nbsp;<a href=\"https:\/\/portal-atlasx.cdg.co.th\/home\/docs\/atlasx-web-service-8\/fundamentals\/create-a-new-webapi\/\">Create a new WebApi<\/a><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#adbac7;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>dotnet new axws --name MyService<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark-dimmed\" style=\"background-color: #22272e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F69D50\">dotnet<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">new<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">axws<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #6CB6FF\">--name<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">MyService<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong><strong>2. \u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32 NuGet<\/strong><\/strong><\/h4>\n\n\n\n<p>\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c&nbsp;<code>nuget.config<\/code>&nbsp;\u0e17\u0e35\u0e48 root \u0e02\u0e2d\u0e07 solution \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e01\u0e33\u0e2b\u0e19\u0e14 package sources \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a AtlasX \u0e41\u0e25\u0e30 Telerik packages<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong><strong><strong>3. \u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32 .env<\/strong><\/strong><\/strong><\/h4>\n\n\n\n<p>copy \u0e44\u0e1f\u0e25\u0e4c&nbsp;<code>.env.example<\/code>&nbsp;\u0e40\u0e1b\u0e47\u0e19&nbsp;<code>.env<\/code>&nbsp;\u0e41\u0e25\u0e49\u0e27\u0e41\u0e01\u0e49\u0e04\u0e48\u0e32\u0e43\u0e2b\u0e49\u0e15\u0e23\u0e07\u0e01\u0e31\u0e1a environment \u0e02\u0e2d\u0e07\u0e15\u0e31\u0e27\u0e40\u0e2d\u0e07<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#adbac7;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>cp .env.example .env<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark-dimmed\" style=\"background-color: #22272e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F69D50\">cp<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">.env.example<\/span><span style=\"color: #ADBAC7\"> <\/span><span style=\"color: #96D0FF\">.env<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong><strong><strong><strong>4. \u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32 Program.cs<\/strong><\/strong><\/strong><\/strong><\/h4>\n\n\n\n<p>\u0e42\u0e04\u0e23\u0e07\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e2b\u0e25\u0e31\u0e01\u0e02\u0e2d\u0e07&nbsp;<code>Program.cs<\/code>&nbsp;\u0e21\u0e35\u0e25\u0e33\u0e14\u0e31\u0e1a\u0e01\u0e32\u0e23 setup \u0e14\u0e31\u0e07\u0e19\u0e35\u0e49<\/p>\n\n\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td>1. \u0e42\u0e2b\u0e25\u0e14 .env<\/td><td>\u0e42\u0e2b\u0e25\u0e14 environment variables \u0e08\u0e32\u0e01\u0e44\u0e1f\u0e25\u0e4c&nbsp;<code>.env<\/code><\/td><\/tr><tr><td>2. Crypto<\/td><td>\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e27\u0e48\u0e32\u0e23\u0e31\u0e19\u0e43\u0e19\u0e42\u0e2b\u0e21\u0e14 encrypt\/decrypt \u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48 \u0e16\u0e49\u0e32\u0e43\u0e0a\u0e48\u0e08\u0e30\u0e2b\u0e22\u0e38\u0e14\u0e17\u0e33\u0e07\u0e32\u0e19\u0e17\u0e31\u0e19\u0e17\u0e35<\/td><\/tr><tr><td>3-4. Builder &amp; Config<\/td><td>\u0e2a\u0e23\u0e49\u0e32\u0e07 builder \u0e41\u0e25\u0e30\u0e42\u0e2b\u0e25\u0e14 configuration \u0e15\u0e32\u0e21 environment \u0e41\u0e25\u0e30\u0e1c\u0e39\u0e01\u0e04\u0e48\u0e32\u0e40\u0e02\u0e49\u0e32 <code>AppSettings<\/code><\/td><\/tr><tr><td>5-6. Services &amp; CORS<\/td><td>\u0e25\u0e07\u0e17\u0e30\u0e40\u0e1a\u0e35\u0e22\u0e19 services \u0e1e\u0e37\u0e49\u0e19\u0e10\u0e32\u0e19\u0e41\u0e25\u0e30\u0e01\u0e33\u0e2b\u0e19\u0e14 CORS policy<\/td><\/tr><tr><td>7-10. Feature Services<\/td><td>\u0e25\u0e07\u0e17\u0e30\u0e40\u0e1a\u0e35\u0e22\u0e19 services \u0e15\u0e32\u0e21 feature \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23 \u0e40\u0e0a\u0e48\u0e19 Database, Redis, File, OAuth<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>\/\/ 1. \u0e42\u0e2b\u0e25\u0e14 .env (Development \u0e40\u0e17\u0e48\u0e32\u0e19\u0e31\u0e49\u0e19)\nEnvironmentUtils.Load();\n\n\/\/ 2. \u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e42\u0e2b\u0e21\u0e14 encrypt\/decrypt (optional)\nif (await CryptoConfigurationUtils.TryProcessCryptoAsync(args))\n{\n    return;\n}\n\n\/\/ 3. \u0e2a\u0e23\u0e49\u0e32\u0e07 builder\nvar builder = WebApplication.CreateBuilder(args);\n\n\/\/ 4. \u0e42\u0e2b\u0e25\u0e14 configuration\nawait builder.Configuration.AddAppSettings(builder.Environment);\nbuilder.Services.Configure&lt;AppSettings>(builder.Configuration.GetSection(\"App\"));\n\n\/\/ 5. \u0e25\u0e07\u0e17\u0e30\u0e40\u0e1a\u0e35\u0e22\u0e19 services\nbuilder.Services.ConfigureWebServer();\nbuilder.Services.AddEndpointsApiExplorer();\nbuilder.Services.AddSwaggerGen();\nbuilder.Services.AddControllersWithViews();\n\n\/\/ 6. CORS\nbuilder.Services.AddCors(options =>\n{\n    options.AddPolicy(\"AllowSpecificOrigins\", corsPolicyBuilder =>\n    {\n        var corsPolicy = builder.Configuration.GetSection(\"App:CorsPolicy\").Get&lt;string[]>() ?? [];\n        corsPolicyBuilder.WithOrigins(corsPolicy)\n            .AllowAnyHeader()\n            .AllowAnyMethod()\n            .AllowCredentials()\n            .SetIsOriginAllowedToAllowWildcardSubdomains();\n    });\n});\n\n\/\/ 7. Database\nbuilder.Services.AddDataAccess(builder.Configuration);\n\n\/\/ 8. Redis \/ Session\nbuilder.Services.AddCache(builder.Configuration.GetSection(\"Redis\")&#91;\"ConnectionString\"&#93;);\nbuilder.Services.AddScoped&lt;SessionService>();\n\n\/\/ 9. File Storage\nbuilder.Services.AddDirectoryAccess(builder.Configuration, \"App:FileServer\");\n\n\/\/ 10. OAuth \/ Auth\nbuilder.Services.AddOAuth(builder.Configuration);\nbuilder.Services.AddAuth(builder.Configuration);\n\n\/\/ Build\nvar app = builder.Build();\n\n\/\/ Middleware\nif (app.Environment.IsProduction())\n{\n    app.UseHsts();\n}\nelse\n{\n    app.UseSwagger();\n    app.UseSwaggerUI();\n}\n\napp.UseCors(\"AllowSpecificOrigins\");\napp.UseAuthentication();\napp.UseAuthorization();\napp.MapControllers();\n\nawait app.RunAsync();<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A9955\">\/\/ 1. \u0e42\u0e2b\u0e25\u0e14 .env (Development \u0e40\u0e17\u0e48\u0e32\u0e19\u0e31\u0e49\u0e19)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">EnvironmentUtils<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">Load<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ 2. \u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e42\u0e2b\u0e21\u0e14 encrypt\/decrypt (optional)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> (<\/span><span style=\"color: #569CD6\">await<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">CryptoConfigurationUtils<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">TryProcessCryptoAsync<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">args<\/span><span style=\"color: #D4D4D4\">))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ 3. \u0e2a\u0e23\u0e49\u0e32\u0e07 builder<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">var<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">WebApplication<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">CreateBuilder<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">args<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ 4. \u0e42\u0e2b\u0e25\u0e14 configuration<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">await<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Configuration<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddAppSettings<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Environment<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">Configure<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #4EC9B0\">AppSettings<\/span><span style=\"color: #D4D4D4\">&gt;(<\/span><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Configuration<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">GetSection<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;App&quot;<\/span><span style=\"color: #D4D4D4\">));<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ 5. \u0e25\u0e07\u0e17\u0e30\u0e40\u0e1a\u0e35\u0e22\u0e19 services<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">ConfigureWebServer<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddEndpointsApiExplorer<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddSwaggerGen<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddControllersWithViews<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ 6. CORS<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddCors<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">options<\/span><span style=\"color: #D4D4D4\"> =&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #9CDCFE\">options<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddPolicy<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;AllowSpecificOrigins&quot;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">corsPolicyBuilder<\/span><span style=\"color: #D4D4D4\"> =&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #569CD6\">var<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">corsPolicy<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Configuration<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">GetSection<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;App:CorsPolicy&quot;<\/span><span style=\"color: #D4D4D4\">).<\/span><span style=\"color: #DCDCAA\">Get<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #569CD6\">string<\/span><span style=\"color: #D4D4D4\">[]&gt;() ?? [];<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #9CDCFE\">corsPolicyBuilder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">WithOrigins<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">corsPolicy<\/span><span style=\"color: #D4D4D4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            .<\/span><span style=\"color: #DCDCAA\">AllowAnyHeader<\/span><span style=\"color: #D4D4D4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            .<\/span><span style=\"color: #DCDCAA\">AllowAnyMethod<\/span><span style=\"color: #D4D4D4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            .<\/span><span style=\"color: #DCDCAA\">AllowCredentials<\/span><span style=\"color: #D4D4D4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            .<\/span><span style=\"color: #DCDCAA\">SetIsOriginAllowedToAllowWildcardSubdomains<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    });<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">});<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ 7. Database<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddDataAccess<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Configuration<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ 8. Redis \/ Session<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddCache<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Configuration<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">GetSection<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;Redis&quot;<\/span><span style=\"color: #D4D4D4\">)&#91;<\/span><span style=\"color: #CE9178\">&quot;ConnectionString&quot;<\/span><span style=\"color: #D4D4D4\">&#93;);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddScoped<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #4EC9B0\">SessionService<\/span><span style=\"color: #D4D4D4\">&gt;();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ 9. File Storage<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddDirectoryAccess<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Configuration<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&quot;App:FileServer&quot;<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ 10. OAuth \/ Auth<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddOAuth<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Configuration<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddAuth<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Configuration<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ Build<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">var<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">app<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">Build<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ Middleware<\/span><\/span>\n<span class=\"line\"><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> (<\/span><span style=\"color: #9CDCFE\">app<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Environment<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">IsProduction<\/span><span style=\"color: #D4D4D4\">())<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #9CDCFE\">app<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">UseHsts<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #C586C0\">else<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #9CDCFE\">app<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">UseSwagger<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #9CDCFE\">app<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">UseSwaggerUI<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">app<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">UseCors<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;AllowSpecificOrigins&quot;<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">app<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">UseAuthentication<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">app<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">UseAuthorization<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">app<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">MapControllers<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">await<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">app<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">RunAsync<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"featured_media":0,"parent":1181,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","meta":{"nav_title":"","positive":"","negative":"","footnotes":""},"docs_category":[],"class_list":["post-1182","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/comments?post=1182"}],"version-history":[{"count":12,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1182\/revisions"}],"predecessor-version":[{"id":4215,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1182\/revisions\/4215"}],"up":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1181"}],"wp:attachment":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/media?parent=1182"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs_category?post=1182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}