Commit 69049aca authored by Maodashu's avatar Maodashu

initiallized

parent c66528d3
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
\ No newline at end of file
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["MatrixOne.SlackApi.WebApi/MatrixOne.SlackApi.WebApi.csproj", "MatrixOne.SlackApi.WebApi/"]
RUN dotnet restore "MatrixOne.SlackApi.WebApi/MatrixOne.SlackApi.WebApi.csproj" -s "http://nuget.matrixone.io:5555/v3/index.json"
COPY . .
WORKDIR "/src/MatrixOne.SlackApi.WebApi"
RUN dotnet build "MatrixOne.SlackApi.WebApi.csproj" -c Release -o /app/build --source "http://nuget.matrixone.io:5555/v3/index.json"
FROM build AS publish
RUN dotnet publish "MatrixOne.SlackApi.WebApi.csproj" -c Release -o /app/publish --no-restore
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MatrixOne.SlackApi.WebApi.dll"]
\ No newline at end of file
......@@ -8,11 +8,19 @@
<DocumentationFile>MatrixOne.SlackApi.WebApi.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Compile Remove="logs\**" />
<Content Remove="logs\**" />
<EmbeddedResource Remove="logs\**" />
<None Remove="logs\**" />
</ItemGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.21" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.12" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
......
......@@ -59,7 +59,17 @@ namespace MatrixOne.SlackApi.WebApi
policy.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod();
});
});
services.AddMvcCore();
services.AddMvcCore().AddCors(options =>
{
options.AddPolicy(options.DefaultPolicyName, policy =>
{
policy.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials()
.SetIsOriginAllowed(origin => true);
});
}).AddNewtonsoftJson();
//配置 Http客户端服务,注入HttpClientFactory
services.AddHttpClient("INTERNAL");//内网专用
......
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
"Swagger": {
"VirtualPath": "/slackapi"
},
"DebugLogging": "ON"
"DebugLogging": "OFF"
}
{
"Swagger": {
"VirtualPath": "/slackapi"
},
"DebugLogging": "ON"
}
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
"Swagger": {
"VirtualPath": ""
},
"DebugLogging": "ON"
}
......@@ -12,7 +12,7 @@
</head>
<body>
<div class="row">
<div class="frame titleText">WebsocketHub Console</div>
<div class="frame titleText">SlackApi Console</div>
<div id="btn_swagger" class="button whiteText">Swagger</div>
<div id="btn_clean_all_logs" class="button whiteText">Clean all logs</div>
<div id="btn_clean_unloaded_logs" class="button whiteText">Clean unloaded logs</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment