public CreateSpaBuildProjectResponse Post(CreateSpaBuildProject request)
        {
            Log.Info(request.ToJson());
            var session     = SessionAs <AuthUserSession>();
            var gitHubToken = session.GetGitHubAccessToken();

            var createProjResponse = CreateTeamCityProject(request);

            var vcsResponse = CreateVcsRoot(request, createProjResponse, gitHubToken);

            try
            {
                if (!request.LocalOnlyApp)
                {
                    IisHelper.AddSite(request.Name, request.HostName);
                }
                else
                {
                    IisHelper.AddLocalOnlySite(request.Name, request.Port);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.Message, e);
            }

            var createBuildConfig = new CreateBuildConfig
            {
                Locator = "id:" + createProjResponse.Id,
                Name    = "Build and Deploy"
            };
            var buildConfigResponse = TeamCityClient.CreateBuildConfig(createBuildConfig);

            TeamCityClient.UpdateBuildConfigParameters(new UpdateBuildConfigParameters
            {
                Locator    = "id:" + buildConfigResponse.Id,
                Properties = new List <CreateTeamCityBuildParameter>
                {
                    TeamCityRequestBuilder
                    .CreateTeamCityBuildParameter(buildConfigResponse.Id, "ss.msdeploy.serverAddress", "localhost",
                                                  "text validationMode='any' display='normal'"),
                    TeamCityRequestBuilder
                    .CreateTeamCityBuildParameter(buildConfigResponse.Id, "ss.msdeploy.iisApp", request.Name,
                                                  "text validationMode='any' display='normal'")
                }
            });

            TeamCityClient.UpdateBuildConfigSettings(new UpdateBuildConfigSetting
            {
                Locator   = "id:" + buildConfigResponse.Id,
                SettingId = "artifactRules",
                Value     = request.WorkingDirectory + "/wwwroot => " + request.WorkingDirectory + "/wwwroot"
            });

            AttachVcsToProject(buildConfigResponse, vcsResponse);
            CreateVcsTrigger(buildConfigResponse);

            CreateNpmInstallStep(request, buildConfigResponse);
            CreateBowerInstallStep(request, buildConfigResponse);
            CreateNuGetRestoreStep(request, buildConfigResponse);
            CreateGruntStep(request, buildConfigResponse);
            CreateCopyAppSettingsStep(request, buildConfigResponse);
            CreateWebDeployPackStep(request, buildConfigResponse);
            CreateWebDeployPushStep(request, buildConfigResponse);

            TeamCityClient.TriggerBuild(new TriggerBuild
            {
                TriggerBuildType = new TriggerBuildType
                {
                    Id = buildConfigResponse.Id
                }
            });

            return(new CreateSpaBuildProjectResponse
            {
                ProjectId = createProjResponse.Id
            });
        }