前后端分离工程搭建
前端 vue-cli-service
后端 ASP.NET Core WebAPI
1. 后端搭建
1.1 新建项目:
模板:Web
->ASP.NET Core Web 应用程序
->.NET Framework
->ASP.NET Core 2.1
->API
编辑TestProject.csproj,添加GenerateDocumentationFile配置节
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
1.2 配置IIS调试
编辑 Properties
–>launchSetting.json
文件
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iis": {
"applicationUrl": "http://xxxxxx/TestProject",
"sslPort": 0
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"TeamCheck": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "api/values",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:5000"
},
"IIS": {
"commandName": "IIS",
"launchBrowser": true,
"launchUrl": "swagger/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
1.3 配置Swagger
详细操作见往期博客 ASP.Net MVCWebApi下集成Swagger UI
2.前端工程
2.1 vui ui
- Base URL:/team/
- PWA App Name:teamcheck
- package.json修改name为小写
添加依赖
- element-ui
- axios
- moment
- lodash
- font-awesome
END |