Showing preview only (313K chars total). Download the full file or copy to clipboard to get everything.
Repository: bradymholt/aspnet-core-react-template
Branch: master
Commit: 2564bc935ee1
Files: 115
Total size: 283.7 KB
Directory structure:
gitextract_5pf0t787/
├── .editorconfig
├── .github/
│ └── FUNDING.yml
├── .gitignore
├── .vscode/
│ ├── launch.json
│ ├── settings.json
│ └── tasks.json
├── LICENSE
├── README.md
├── api/
│ ├── .config/
│ │ └── dotnet-tools.json
│ ├── Controllers/
│ │ ├── AuthController.cs
│ │ └── ContactController.cs
│ ├── Extensions/
│ │ └── StringExtension.cs
│ ├── Middleware/
│ │ ├── SpaFallbackMiddleware.cs
│ │ └── SpaFallbackOptions.cs
│ ├── Migrations/
│ │ ├── 20171204210645_Initial.Designer.cs
│ │ ├── 20171204210645_Initial.cs
│ │ ├── 20200128145031_1580223026.Designer.cs
│ │ ├── 20200128145031_1580223026.cs
│ │ └── DefaultDbContextModelSnapshot.cs
│ ├── Models/
│ │ ├── ApplicationUser.cs
│ │ ├── Contact.cs
│ │ ├── DefaultDbContext.cs
│ │ ├── DefaultDbContextInitializer.cs
│ │ └── DesignTimeDefaultDbContext.cs
│ ├── NuGet.Config
│ ├── Program.cs
│ ├── Properties/
│ │ └── launchSettings.json
│ ├── Services/
│ │ ├── EmailSender.cs
│ │ ├── EmailSenderOptions.cs
│ │ ├── IEmailSender.cs
│ │ └── JwtOptions.cs
│ ├── Startup.cs
│ ├── ViewModels/
│ │ ├── ConfirmEmail.cs
│ │ └── NewUser.cs
│ ├── api.csproj
│ ├── appsettings.json
│ └── log/
│ └── development-20170420.log
├── api.sln
├── api.test/
│ ├── Controller/
│ │ └── Tests.cs
│ ├── ControllerTests.cs
│ ├── NuGet.Config
│ ├── Unit/
│ │ └── Tests.cs
│ └── api.test.csproj
├── client-react/
│ ├── boot.tsx
│ ├── components/
│ │ ├── Auth.tsx
│ │ ├── ContactForm.tsx
│ │ ├── Contacts.tsx
│ │ ├── Error.tsx
│ │ ├── Header.tsx
│ │ └── Routes.tsx
│ ├── index.ejs
│ ├── polyfills/
│ │ ├── array-find.d.ts
│ │ ├── array-find.ts
│ │ ├── object-assign.d.ts
│ │ └── object-assign.ts
│ ├── services/
│ │ ├── Auth.ts
│ │ ├── Contacts.ts
│ │ └── RestUtilities.ts
│ ├── stores/
│ │ └── Auth.ts
│ ├── styles/
│ │ ├── auth.styl
│ │ ├── contacts.styl
│ │ ├── global.css
│ │ └── styles.d.ts
│ ├── tsconfig.json
│ ├── webpack.config.js
│ └── webpack.config.release.js
├── client-react.test/
│ ├── polyfill/
│ │ └── localStorage.js
│ ├── tests/
│ │ └── Contacts.tsx
│ ├── tests.tsx
│ ├── tsconfig.json
│ └── utils.ts
├── docker-compose.yml
├── global.json
├── ops/
│ ├── README.md
│ ├── config.yml.example
│ ├── deploy.yml
│ ├── group_vars/
│ │ └── all
│ ├── library/
│ │ └── ghetto_json
│ ├── provision.yml
│ └── roles/
│ ├── deploy/
│ │ ├── defaults/
│ │ │ └── main.yml
│ │ ├── meta/
│ │ │ └── main.yml
│ │ └── tasks/
│ │ └── main.yml
│ ├── deploy_user/
│ │ ├── meta/
│ │ │ └── main.yml
│ │ └── tasks/
│ │ └── main.yml
│ ├── dotnetcore/
│ │ ├── defaults/
│ │ │ └── main.yml
│ │ └── tasks/
│ │ └── main.yml
│ ├── firewall/
│ │ ├── handlers/
│ │ │ └── main.yml
│ │ └── tasks/
│ │ └── main.yml
│ ├── nginx/
│ │ ├── defaults/
│ │ │ └── main.yml
│ │ ├── handlers/
│ │ │ └── main.yml
│ │ ├── tasks/
│ │ │ └── main.yml
│ │ └── templates/
│ │ └── etc_nginx_sites-available.conf.j2
│ ├── postgresql/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── defaults/
│ │ │ └── main.yml
│ │ ├── handlers/
│ │ │ └── main.yml
│ │ ├── tasks/
│ │ │ ├── backup.yml
│ │ │ ├── configure.yml
│ │ │ ├── install.yml
│ │ │ └── main.yml
│ │ ├── templates/
│ │ │ └── pgsql_backup.sh.j2
│ │ └── vars/
│ │ └── main.yml
│ ├── s3cmd/
│ │ ├── meta/
│ │ │ └── main.yml
│ │ ├── tasks/
│ │ │ └── main.yml
│ │ └── templates/
│ │ └── s3cfg.j2
│ ├── ssl/
│ │ ├── defaults/
│ │ │ └── main.yml
│ │ ├── meta/
│ │ │ └── main.yml
│ │ ├── tasks/
│ │ │ └── main.yml
│ │ └── templates/
│ │ └── config.j2
│ └── supervisor/
│ ├── defaults/
│ │ └── main.yml
│ ├── handlers/
│ │ └── main.yml
│ ├── tasks/
│ │ └── main.yml
│ └── templates/
│ └── etc_supervisor_conf.d_app_name.conf.j2
├── package.json
└── scripts/
└── create-migration.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
root = true
[*]
end_of_line = lf
charset = utf-8
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
indent_size = 2
[*.{js,ts,tsx}]
indent_size = 4
================================================
FILE: .github/FUNDING.yml
================================================
github: [bradymholt]
================================================
FILE: .gitignore
================================================
.DS_Store
# dotnet core
bin/
obj/
project.lock.json
NuGetScratch/
api/wwwroot/**
!api/wwwroot/scratch.html
!api/wwwroot/favicon.ico
# node
node_modules/
typings/
npm-debug.log
# client-react
client-react/components/*.js
client-react.test/build
!client-react.test/build/client-react/styles/
# ops
ops/hosts
ops/config.yml
ops/*.retry
# other
*.js.map
# IDE
.idea/
.vs/
================================================
FILE: .vscode/launch.json
================================================
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug api/ (server)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/api/bin/Debug/netcoreapp3.1/api.dll",
"args": [],
"env": {
"ASPNETCORE_ENVIRONMENT": "Development",
"NODE_PATH": "../node_modules/"
},
"cwd": "${workspaceRoot}/api",
"externalConsole": false,
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "Debug client-react.test/ (Mocha tests)",
"type": "node",
"request": "launch",
"protocol": "inspector",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": [
"--require",
"ignore-styles",
"--recursive",
"client-react.test/build/client-react.test"
],
"cwd": "${workspaceRoot}",
"preLaunchTask": "pretest:client",
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"sourceMaps": true
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
================================================
FILE: .vscode/settings.json
================================================
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/bin": true,
"**/obj": true
}
}
================================================
FILE: .vscode/tasks.json
================================================
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "npm",
"isShellCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"tasks": [
{
"taskName": "build",
"args": [
"run",
"build"
],
"isBuildCommand": true
},
{
"taskName": "test",
"args": [
"run",
"test"
],
"isTestCommand": true
},
{
"taskName": "pretest:client",
"args":[
"run",
"pretest:client"
]
}
]
}
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2017 Brady Holt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# ASP.NET Core / React SPA Template App
<img align="left" src="https://user-images.githubusercontent.com/759811/210273710-b13913e2-0a71-4d9d-94da-1fe538b8a73e.gif"/>
<br/>
**Would you take a quick second and ⭐️ my repo?**
<br/>
This app is a template application using ASP.NET Core 3.1 for a REST/JSON API server and React for a web client.

## Overview of Stack
- Server
- ASP.NET Core 3.1
- PostgreSQL 10
- Entity Framework Core w/ EF Migrations
- JSON Web Token (JWT) authorization
- Docker used for development PostgreSQL database and MailCatcher server
- Client
- React 16
- Webpack for asset bundling and HMR (Hot Module Replacement)
- CSS Modules
- Fetch API for REST requests
- Testing
- xUnit for .NET Core
- Enzyme for React
- MailCatcher for development email delivery
- DevOps
- Ansible playbook for provisioning (Nginx reverse proxy, SSL via Let's Encrypt, PostgreSQL backups to S3)
- Ansible playbook for deployment
## Demo
[](https://www.youtube.com/watch?v=xh5plRGg3Nc)
## Setup
1. Install the following:
- [.NET Core 3.1](https://www.microsoft.com/net/core)
- [Node.js >= v8](https://nodejs.org/en/download/)
- [Ansible >= 2.6](http://docs.ansible.com/ansible/intro_installation.html)
- [Docker](https://docs.docker.com/engine/installation/)
2. Run `npm install && npm start`
3. Open browser and navigate to [http://localhost:5000](http://localhost:5000).
This template was developed and tested on macOS Sierra but should run on Windows (for development) as well. If you experience any issues getting it to run on Windows and work through them, please submit a PR! The production provisioning and deployment scripts (`provision:prod` and `deploy:prod`) use Ansible and require a Linux/Ubuntu >= 16.04 target host.
## Scripts
### `npm install`
When first cloning the repo or adding new dependencies, run this command. This will:
- Install Node dependencies from package.json
- Install .NET Core dependencies from api/api.csproj and api.test/api.test.csproj (using dotnet restore)
### `npm start`
To start the app for development, run this command. This will:
- Run `docker-compose up` to ensure the PostgreSQL and MailCatcher Docker images are up and running
- Run `dotnet watch run` which will build the app (if changed), watch for changes and start the web server on http://localhost:5000
- Run Webpack dev middleware with HMR via [ASP.NET JavaScriptServices](https://github.com/aspnet/JavaScriptServices)
### `npm run migrate`
After making changes to Entity Framework models in `api/Models/`, run this command to generate and run a migration on the database. A timestamp will be used for the migration name.
### `npm test`
This will run the xUnit tests in api.test/ and the Mocha/Enzyme tests in client-react.test/.
### `npm run provision:prod`
_Before running this script, you need to create an ops/config.yml file first. See the [ops README](ops/) for instructions._
This will run the ops/provision.yml Ansible playbook and provision hosts in ops/hosts inventory file. Ubuntu 16.04 (Xenial) and Ubuntu 18.04 (Bionic) is supported and tested.
This prepares the hosts to recieve deployments by doing the following:
- Install Nginx
- Generate a SSL certificate from [Let's Encrypt](https://letsencrypt.org/) and configure Nginx to use it
- Install .Net Core
- Install Supervisor (will run/manage the ASP.NET app)
- Install PostgreSQL
- Setup a cron job to automatically backup the PostgreSQL database, compress it, and upload it to S3.
- Setup UFW (firewall) to lock everything down except inbound SSH and web traffic
- Create a deploy user, directory for deployments and configure Nginx to serve from this directory
### `npm run deploy:prod`
_Before running this script, you need to create a ops/config.yml file first. See the [ops README](ops/) for instructions._
This script will:
- Build release Webpack bundles
- Package the .NET Core application in Release mode (dotnet publish)
- Run the ops/deploy.yml Ansible playbook to deploy this app to hosts in /ops/config.yml inventory file.
This does the following:
- Copies the build assets to the remote host(s)
- Updates the `appsettings.json` file with PostgreSQL credentials specified in ops/group_vars/all file and the app URL (needed for JWT tokens)
- Restarts the app so that changes will be picked up
Entity Framework Migrations are [automatically applied upon startup](https://github.com/bradymholt/aspnet-core-react-template/blob/master/api/Program.cs#L23-L24) so they will run when the app restarts.
## Development Email Delivery
This template includes a [MailCatcher](https://mailcatcher.me/) Docker image so that when email is sent during development (i.e. new user registration), it can be viewed
in the MailCacher web interface at [http://localhost:1080/](http://localhost:1080/).
## Older Versions
This template was originally created on .NET Core 1.0 and has been upgraded with new versions of .NET Core. Older versions can be found on the [Releases](https://github.com/bradymholt/aspnet-core-react-template/releases) page.
## Visual Studio Code config
This project has [Visual Studio Code](https://code.visualstudio.com/) tasks and debugger launch config located in .vscode/.
### Tasks
- **Command+Shift+B** - Runs the "build" task which builds the api/ project
- **Command+Shift+T** - Runs the "test" task which runs the xUnit tests in api.test/ and Mocha/Enzyme tests in client-react.test/.
### Debug Launcher
With the following debugger launch configs, you can set breakpoints in api/ or the the Mocha tests in client-react.test/ and have full debugging support.
- **Debug api/ (server)** - Runs the vscode debugger (breakpoints) on the api/ .NET Core app
- **Debug client-react.test/ (Mocha tests)** - Runs the vscode debugger on the client-react.test/ Mocha tests
## Credit
The following resources were helpful in setting up this template:
- [Sample for implementing Authentication with a React Flux app and JWTs](https://github.com/auth0-blog/react-flux-jwt-authentication-sample)
- [Angular 2, React, and Knockout apps on ASP.NET Core](http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/)
- [Setting up ASP.NET v5 (vNext) to use JWT tokens (using OpenIddict)](http://capesean.co.za/blog/asp-net-5-jwt-tokens/)
- [Cross-platform Single Page Applications with ASP.NET Core 1.0, Angular 2 & TypeScript](https://chsakell.com/2016/01/01/cross-platform-single-page-applications-with-asp-net-5-angular-2-typescript/)
- [Stack Overflow - Token Based Authentication in ASP.NET Core](http://stackoverflow.com/questions/30546542/token-based-authentication-in-asp-net-core-refreshed)
- [SPA example of a token based authentication implementation using the Aurelia front end framework and ASP.NET core]( https://github.com/alexandre-spieser/AureliaAspNetCoreAuth)
- [A Real-World React.js Setup for ASP.NET Core and MVC5](https://www.simple-talk.com/dotnet/asp-net/a-real-world-react-js-setup-for-asp-net-core-and-mvc)
- [Customising ASP.NET Core Identity EF Core naming conventions for PostgreSQL](https://andrewlock.net/customising-asp-net-core-identity-ef-core-naming-conventions-for-postgresql)
- My own perseverance because this took a _lot_ of time to get right 🤓
================================================
FILE: api/.config/dotnet-tools.json
================================================
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "3.1.1",
"commands": [
"dotnet-ef"
]
}
}
}
================================================
FILE: api/Controllers/AuthController.cs
================================================
using System;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using aspnetCoreReactTemplate.Models;
using aspnetCoreReactTemplate.Services;
using aspnetCoreReactTemplate.ViewModels;
using System.Security.Claims;
using System.IdentityModel.Tokens.Jwt;
using Microsoft.IdentityModel.Tokens;
namespace aspnetCoreReactTemplate.Controllers
{
public class AuthController : Controller
{
private readonly UserManager<ApplicationUser> _userManager;
private readonly IOptions<IdentityOptions> _identityOptions;
private readonly JwtOptions _jwtOptions;
private readonly IEmailSender _emailSender;
private readonly SignInManager<ApplicationUser> _signInManager;
private readonly ILogger _logger;
public AuthController(
UserManager<ApplicationUser> userManager,
IOptions<IdentityOptions> identityOptions,
IOptions<JwtOptions> jwtOptions,
IEmailSender emailSender,
SignInManager<ApplicationUser> signInManager,
ILoggerFactory loggerFactory)
{
_userManager = userManager;
_identityOptions = identityOptions;
_jwtOptions = jwtOptions.Value;
_emailSender = emailSender;
_signInManager = signInManager;
_logger = loggerFactory.CreateLogger<AuthController>();
}
[AllowAnonymous]
[HttpPost("~/api/auth/login")]
[Produces("application/json")]
public async Task<IActionResult> Login(string username, string password)
{
// Ensure the username and password is valid.
var user = await _userManager.FindByNameAsync(username);
if (user == null || !await _userManager.CheckPasswordAsync(user, password))
{
return BadRequest(new
{
error = "", //OpenIdConnectConstants.Errors.InvalidGrant,
error_description = "The username or password is invalid."
});
}
// Ensure the email is confirmed.
if (!await _userManager.IsEmailConfirmedAsync(user))
{
return BadRequest(new
{
error = "email_not_confirmed",
error_description = "You must have a confirmed email to log in."
});
}
_logger.LogInformation($"User logged in (id: {user.Id})");
// Generate and issue a JWT token
var claims = new [] {
new Claim(ClaimTypes.Name, user.Email),
new Claim(JwtRegisteredClaimNames.Sub, user.Email),
new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString())
};
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_jwtOptions.key));
var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
var token = new JwtSecurityToken(
issuer: _jwtOptions.issuer,
audience: _jwtOptions.issuer,
claims: claims,
expires: DateTime.Now.AddMinutes(30),
signingCredentials: creds);
return Ok(new { token = new JwtSecurityTokenHandler().WriteToken(token) });
}
[AllowAnonymous]
[HttpPost("~/api/auth/register")]
public async Task<IActionResult> Register(NewUser model)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
var user = new ApplicationUser { UserName = model.username, Email = model.username };
var result = await _userManager.CreateAsync(user, model.password);
if (result.Succeeded)
{
_logger.LogInformation($"New user registered (id: {user.Id})");
if (!user.EmailConfirmed)
{
// Send email confirmation email
var confirmToken = await _userManager.GenerateEmailConfirmationTokenAsync(user);
var emailConfirmUrl = Url.RouteUrl("ConfirmEmail", new { uid = user.Id, token = confirmToken }, this.Request.Scheme);
await _emailSender.SendEmailAsync(model.username, "Please confirm your account",
$"Please confirm your account by clicking this <a href=\"{emailConfirmUrl}\">link</a>."
);
_logger.LogInformation($"Sent email confirmation email (id: {user.Id})");
}
// Create a new authentication ticket.
//var ticket = await CreateTicket(user);
_logger.LogInformation($"User logged in (id: {user.Id})");
return Ok();
}
else
{
return BadRequest(new { general = result.Errors.Select(x => x.Description) });
}
}
[AllowAnonymous]
[HttpGet("~/api/auth/confirm", Name = "ConfirmEmail")]
public async Task<IActionResult> Confirm(string uid, string token)
{
var user = await _userManager.FindByIdAsync(uid);
var confirmResult = await _userManager.ConfirmEmailAsync(user, token);
if (confirmResult.Succeeded)
{
return Redirect("/?confirmed=1");
}
else
{
return Redirect("/error/email-confirm");
}
}
}
}
================================================
FILE: api/Controllers/ContactController.cs
================================================
using System.Linq;
using System.Collections.Generic;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using aspnetCoreReactTemplate.Models;
using Microsoft.EntityFrameworkCore;
using System.Threading.Tasks;
namespace aspnetCoreReactTemplate.Controllers
{
[Authorize]
[Route("api/[controller]")]
public class ContactsController : Controller
{
private readonly DefaultDbContext _context;
public ContactsController(DefaultDbContext context)
{
_context = context;
}
// GET api/contacts
[HttpGet]
public IEnumerable<Contact> Get()
{
return _context.Contacts.OrderBy((o)=> o.LastName);
}
// GET api/contacts/5
[HttpGet("{id}", Name = "GetContact")]
public Contact Get(int id)
{
return _context.Contacts.Find(id);
}
// GET api/contacts/?=
[HttpGet("search")]
public IEnumerable<Contact> Search(string q)
{
return _context.Contacts.
Where((c)=> c.LastName.ToLower().Contains(q.ToLower()) || c.FirstName.ToLower().Contains(q.ToLower())).
OrderBy((o) => o.LastName);
}
// POST api/contacts
[HttpPost]
public async Task<IActionResult> Post([FromBody]Contact model)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
_context.Contacts.Add(model);
await _context.SaveChangesAsync();
return CreatedAtRoute("GetContact", new { id = model.Id }, model);
}
// PUT api/contacts/5
[HttpPut("{id}")]
public async Task<IActionResult> Put(int id, [FromBody]Contact model)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
model.Id = id;
_context.Update(model);
await _context.SaveChangesAsync();
return Ok();
}
// DELETE api/contacts/5
[HttpDelete("{id}")]
public async Task<IActionResult> Delete(int id)
{
var contact = new Contact() { Id = id };
_context.Entry(contact).State = EntityState.Deleted;
await _context.SaveChangesAsync();
return Ok();
}
}
}
================================================
FILE: api/Extensions/StringExtension.cs
================================================
using System.Text.RegularExpressions;
namespace aspnetCoreReactTemplate.Extensions
{
public static class StringExtensions
{
public static string ToSnakeCase(this string input)
{
if (string.IsNullOrEmpty(input))
{
return input;
}
var startUnderscores = Regex.Match(input, @"^_+");
return startUnderscores + Regex.Replace(input, @"([a-z0-9])([A-Z])", "$1_$2").ToLower();
}
}
}
================================================
FILE: api/Middleware/SpaFallbackMiddleware.cs
================================================
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
namespace aspnetCoreReactTemplate
{
/*
Middleware that will rewrite (not redirect!) nested SPA page requests to the SPA root path.
For SPA apps that are using client-side routing, a refresh or direct request for a nested path will
be received by the server but the root path page should be actually be served because the client
is responsible for routing, not the server. Only those requests not prefixed with
options.ApiPathPrefix and not containing a path extention (i.e. image.png, scripts.js) will
be rewritten.
(SpaFallbackOptions options):
ApiPathPrefix - The api path prefix is what requests for the REST api begin with. These
will be ignored and not rewritten. So, if this is supplied as 'api',
any requests starting with 'api' will not be rewritten.
RewritePath - What path to rewrite to (usually '/')
Examples:
(options.ApiPathPrefix == "api", options.RewritePath="/")
http://localhost:5000/api/auth/login => (no rewrite)
http://localhost:5000/style.css => (no rewrite)
http://localhost:5000/contacts => /
http://localhost:5000/contacts/5/edit => /
*/
public class SpaFallbackMiddleware
{
private readonly RequestDelegate _next;
private readonly ILogger _logger;
private SpaFallbackOptions _options;
public SpaFallbackMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, SpaFallbackOptions options)
{
_next = next;
_logger = loggerFactory.CreateLogger<SpaFallbackMiddleware>();
_options = options;
}
public async Task Invoke(HttpContext context)
{
_logger.LogInformation("Handling request: " + context.Request.Path);
// If request path starts with _apiPathPrefix and the path does not have an extension (i.e. .css, .js, .png)
if (!context.Request.Path.Value.StartsWith(_options.ApiPathPrefix) && !context.Request.Path.Value.Contains("."))
{
_logger.LogInformation($"Rewriting path: {context.Request.Path} > {_options.RewritePath}");
context.Request.Path = _options.RewritePath;
}
await _next.Invoke(context);
_logger.LogInformation("Finished handling request.");
}
}
public static class SpaFallbackExtensions
{
public static IApplicationBuilder UseSpaFallback(this IApplicationBuilder builder, SpaFallbackOptions options)
{
if (options == null)
{
options = new SpaFallbackOptions();
}
return builder.UseMiddleware<SpaFallbackMiddleware>(options);
}
}
}
================================================
FILE: api/Middleware/SpaFallbackOptions.cs
================================================
namespace aspnetCoreReactTemplate
{
public class SpaFallbackOptions
{
public SpaFallbackOptions()
{
this.ApiPathPrefix = "/api";
this.RewritePath = "/";
}
public string ApiPathPrefix { get; set; }
public string RewritePath { get; set; }
}
}
================================================
FILE: api/Migrations/20171204210645_Initial.Designer.cs
================================================
// <auto-generated />
using aspnetCoreReactTemplate.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using System;
namespace api.Migrations
{
[DbContext(typeof(DefaultDbContext))]
[Migration("20171204210645_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452");
modelBuilder.Entity("aspnetCoreReactTemplate.Models.ApplicationUser", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id");
b.Property<int>("AccessFailedCount")
.HasColumnName("access_failed_count");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("concurrency_stamp");
b.Property<string>("Email")
.HasColumnName("email")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.HasColumnName("email_confirmed");
b.Property<string>("GivenName")
.HasColumnName("given_name");
b.Property<bool>("LockoutEnabled")
.HasColumnName("lockout_enabled");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnName("lockout_end");
b.Property<string>("NormalizedEmail")
.HasColumnName("normalized_email")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.HasColumnName("normalized_user_name")
.HasMaxLength(256);
b.Property<string>("PasswordHash")
.HasColumnName("password_hash");
b.Property<string>("PhoneNumber")
.HasColumnName("phone_number");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnName("phone_number_confirmed");
b.Property<string>("SecurityStamp")
.HasColumnName("security_stamp");
b.Property<bool>("TwoFactorEnabled")
.HasColumnName("two_factor_enabled");
b.Property<string>("UserName")
.HasColumnName("user_name")
.HasMaxLength(256);
b.HasKey("Id")
.HasName("pk_users");
b.HasIndex("NormalizedEmail")
.HasName("email_index");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("user_name_index");
b.ToTable("users");
});
modelBuilder.Entity("aspnetCoreReactTemplate.Models.Contact", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnName("id");
b.Property<string>("email")
.HasColumnName("email")
.HasMaxLength(30);
b.Property<string>("firstName")
.IsRequired()
.HasColumnName("first_name");
b.Property<string>("lastName")
.IsRequired()
.HasColumnName("last_name");
b.Property<string>("phone")
.HasColumnName("phone");
b.HasKey("id")
.HasName("pk_contacts");
b.ToTable("contacts");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("concurrency_stamp");
b.Property<string>("Name")
.HasColumnName("name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasColumnName("normalized_name")
.HasMaxLength(256);
b.HasKey("Id")
.HasName("pk_roles");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("role_name_index");
b.ToTable("roles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id");
b.Property<string>("ClaimType")
.HasColumnName("claim_type");
b.Property<string>("ClaimValue")
.HasColumnName("claim_value");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnName("role_id");
b.HasKey("Id")
.HasName("pk_role_claims");
b.HasIndex("RoleId")
.HasName("ix_role_claims_role_id");
b.ToTable("role_claims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id");
b.Property<string>("ClaimType")
.HasColumnName("claim_type");
b.Property<string>("ClaimValue")
.HasColumnName("claim_value");
b.Property<string>("UserId")
.IsRequired()
.HasColumnName("user_id");
b.HasKey("Id")
.HasName("pk_user_claims");
b.HasIndex("UserId")
.HasName("ix_user_claims_user_id");
b.ToTable("user_claims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnName("login_provider");
b.Property<string>("ProviderKey")
.HasColumnName("provider_key");
b.Property<string>("ProviderDisplayName")
.HasColumnName("provider_display_name");
b.Property<string>("UserId")
.IsRequired()
.HasColumnName("user_id");
b.HasKey("LoginProvider", "ProviderKey")
.HasName("pk_user_logins");
b.HasIndex("UserId")
.HasName("ix_user_logins_user_id");
b.ToTable("user_logins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnName("user_id");
b.Property<string>("RoleId")
.HasColumnName("role_id");
b.HasKey("UserId", "RoleId")
.HasName("pk_user_roles");
b.HasIndex("RoleId")
.HasName("ix_user_roles_role_id");
b.ToTable("user_roles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnName("user_id");
b.Property<string>("LoginProvider")
.HasColumnName("login_provider");
b.Property<string>("Name")
.HasColumnName("name");
b.Property<string>("Value")
.HasColumnName("value");
b.HasKey("UserId", "LoginProvider", "Name")
.HasName("pk_user_tokens");
b.ToTable("user_tokens");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
.WithMany()
.HasForeignKey("RoleId")
.HasConstraintName("fk_role_claims_roles_role_id")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("aspnetCoreReactTemplate.Models.ApplicationUser")
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_user_claims_users_user_id")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("aspnetCoreReactTemplate.Models.ApplicationUser")
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_user_logins_users_user_id")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
.WithMany()
.HasForeignKey("RoleId")
.HasConstraintName("fk_user_roles_roles_role_id")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("aspnetCoreReactTemplate.Models.ApplicationUser")
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_user_roles_users_user_id")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("aspnetCoreReactTemplate.Models.ApplicationUser")
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_user_tokens_users_user_id")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}
================================================
FILE: api/Migrations/20171204210645_Initial.cs
================================================
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using System;
using System.Collections.Generic;
namespace api.Migrations
{
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "contacts",
columns: table => new
{
id = table.Column<int>(type: "int4", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
email = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: true),
first_name = table.Column<string>(type: "text", nullable: false),
last_name = table.Column<string>(type: "text", nullable: false),
phone = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk_contacts", x => x.id);
});
migrationBuilder.CreateTable(
name: "roles",
columns: table => new
{
id = table.Column<string>(type: "text", nullable: false),
concurrency_stamp = table.Column<string>(type: "text", nullable: true),
name = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true),
normalized_name = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk_roles", x => x.id);
});
migrationBuilder.CreateTable(
name: "users",
columns: table => new
{
id = table.Column<string>(type: "text", nullable: false),
access_failed_count = table.Column<int>(type: "int4", nullable: false),
concurrency_stamp = table.Column<string>(type: "text", nullable: true),
email = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true),
email_confirmed = table.Column<bool>(type: "bool", nullable: false),
given_name = table.Column<string>(type: "text", nullable: true),
lockout_enabled = table.Column<bool>(type: "bool", nullable: false),
lockout_end = table.Column<DateTimeOffset>(type: "timestamptz", nullable: true),
normalized_email = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true),
normalized_user_name = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true),
password_hash = table.Column<string>(type: "text", nullable: true),
phone_number = table.Column<string>(type: "text", nullable: true),
phone_number_confirmed = table.Column<bool>(type: "bool", nullable: false),
security_stamp = table.Column<string>(type: "text", nullable: true),
two_factor_enabled = table.Column<bool>(type: "bool", nullable: false),
user_name = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk_users", x => x.id);
});
migrationBuilder.CreateTable(
name: "role_claims",
columns: table => new
{
id = table.Column<int>(type: "int4", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
claim_type = table.Column<string>(type: "text", nullable: true),
claim_value = table.Column<string>(type: "text", nullable: true),
role_id = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_role_claims", x => x.id);
table.ForeignKey(
name: "fk_role_claims_roles_role_id",
column: x => x.role_id,
principalTable: "roles",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "user_claims",
columns: table => new
{
id = table.Column<int>(type: "int4", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
claim_type = table.Column<string>(type: "text", nullable: true),
claim_value = table.Column<string>(type: "text", nullable: true),
user_id = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_user_claims", x => x.id);
table.ForeignKey(
name: "fk_user_claims_users_user_id",
column: x => x.user_id,
principalTable: "users",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "user_logins",
columns: table => new
{
login_provider = table.Column<string>(type: "text", nullable: false),
provider_key = table.Column<string>(type: "text", nullable: false),
provider_display_name = table.Column<string>(type: "text", nullable: true),
user_id = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_user_logins", x => new { x.login_provider, x.provider_key });
table.ForeignKey(
name: "fk_user_logins_users_user_id",
column: x => x.user_id,
principalTable: "users",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "user_roles",
columns: table => new
{
user_id = table.Column<string>(type: "text", nullable: false),
role_id = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_user_roles", x => new { x.user_id, x.role_id });
table.ForeignKey(
name: "fk_user_roles_roles_role_id",
column: x => x.role_id,
principalTable: "roles",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_user_roles_users_user_id",
column: x => x.user_id,
principalTable: "users",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "user_tokens",
columns: table => new
{
user_id = table.Column<string>(type: "text", nullable: false),
login_provider = table.Column<string>(type: "text", nullable: false),
name = table.Column<string>(type: "text", nullable: false),
value = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk_user_tokens", x => new { x.user_id, x.login_provider, x.name });
table.ForeignKey(
name: "fk_user_tokens_users_user_id",
column: x => x.user_id,
principalTable: "users",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "ix_role_claims_role_id",
table: "role_claims",
column: "role_id");
migrationBuilder.CreateIndex(
name: "role_name_index",
table: "roles",
column: "normalized_name",
unique: true);
migrationBuilder.CreateIndex(
name: "ix_user_claims_user_id",
table: "user_claims",
column: "user_id");
migrationBuilder.CreateIndex(
name: "ix_user_logins_user_id",
table: "user_logins",
column: "user_id");
migrationBuilder.CreateIndex(
name: "ix_user_roles_role_id",
table: "user_roles",
column: "role_id");
migrationBuilder.CreateIndex(
name: "email_index",
table: "users",
column: "normalized_email");
migrationBuilder.CreateIndex(
name: "user_name_index",
table: "users",
column: "normalized_user_name",
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "contacts");
migrationBuilder.DropTable(
name: "role_claims");
migrationBuilder.DropTable(
name: "user_claims");
migrationBuilder.DropTable(
name: "user_logins");
migrationBuilder.DropTable(
name: "user_roles");
migrationBuilder.DropTable(
name: "user_tokens");
migrationBuilder.DropTable(
name: "roles");
migrationBuilder.DropTable(
name: "users");
}
}
}
================================================
FILE: api/Migrations/20200128145031_1580223026.Designer.cs
================================================
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using aspnetCoreReactTemplate.Models;
namespace api.Migrations
{
[DbContext(typeof(DefaultDbContext))]
[Migration("20200128145031_1580223026")]
partial class _1580223026
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
.HasAnnotation("ProductVersion", "3.1.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnName("id")
.HasColumnType("text");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("concurrency_stamp")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasColumnName("normalized_name")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.HasKey("Id")
.HasName("pk_roles");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("role_name_index");
b.ToTable("roles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("ClaimType")
.HasColumnName("claim_type")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnName("claim_value")
.HasColumnType("text");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnName("role_id")
.HasColumnType("text");
b.HasKey("Id")
.HasName("pk_role_claims");
b.HasIndex("RoleId")
.HasName("ix_role_claims_role_id");
b.ToTable("role_claims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("ClaimType")
.HasColumnName("claim_type")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnName("claim_value")
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnName("user_id")
.HasColumnType("text");
b.HasKey("Id")
.HasName("pk_user_claims");
b.HasIndex("UserId")
.HasName("ix_user_claims_user_id");
b.ToTable("user_claims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnName("login_provider")
.HasColumnType("text");
b.Property<string>("ProviderKey")
.HasColumnName("provider_key")
.HasColumnType("text");
b.Property<string>("ProviderDisplayName")
.HasColumnName("provider_display_name")
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnName("user_id")
.HasColumnType("text");
b.HasKey("LoginProvider", "ProviderKey")
.HasName("pk_user_logins");
b.HasIndex("UserId")
.HasName("ix_user_logins_user_id");
b.ToTable("user_logins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnName("user_id")
.HasColumnType("text");
b.Property<string>("RoleId")
.HasColumnName("role_id")
.HasColumnType("text");
b.HasKey("UserId", "RoleId")
.HasName("pk_user_roles");
b.HasIndex("RoleId")
.HasName("ix_user_roles_role_id");
b.ToTable("user_roles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnName("user_id")
.HasColumnType("text");
b.Property<string>("LoginProvider")
.HasColumnName("login_provider")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b.Property<string>("Value")
.HasColumnName("value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name")
.HasName("pk_user_tokens");
b.ToTable("user_tokens");
});
modelBuilder.Entity("aspnetCoreReactTemplate.Models.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnName("id")
.HasColumnType("text");
b.Property<int>("AccessFailedCount")
.HasColumnName("access_failed_count")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("concurrency_stamp")
.HasColumnType("text");
b.Property<string>("Email")
.HasColumnName("email")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.HasColumnName("email_confirmed")
.HasColumnType("boolean");
b.Property<string>("GivenName")
.HasColumnName("given_name")
.HasColumnType("text");
b.Property<bool>("LockoutEnabled")
.HasColumnName("lockout_enabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnName("lockout_end")
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasColumnName("normalized_email")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.HasColumnName("normalized_user_name")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.Property<string>("PasswordHash")
.HasColumnName("password_hash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnName("phone_number")
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnName("phone_number_confirmed")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnName("security_stamp")
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnName("two_factor_enabled")
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasColumnName("user_name")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.HasKey("Id")
.HasName("pk_users");
b.HasIndex("NormalizedEmail")
.HasName("email_index");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("user_name_index");
b.ToTable("users");
});
modelBuilder.Entity("aspnetCoreReactTemplate.Models.Contact", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Email")
.HasColumnName("email")
.HasColumnType("character varying(30)")
.HasMaxLength(30);
b.Property<string>("FirstName")
.IsRequired()
.HasColumnName("first_name")
.HasColumnType("text");
b.Property<string>("LastName")
.IsRequired()
.HasColumnName("last_name")
.HasColumnType("text");
b.Property<string>("Phone")
.HasColumnName("phone")
.HasColumnType("text");
b.HasKey("Id")
.HasName("pk_contacts");
b.ToTable("contacts");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.HasConstraintName("fk_role_claims_roles_role_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("aspnetCoreReactTemplate.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_user_claims_asp_net_users_user_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("aspnetCoreReactTemplate.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_user_logins_asp_net_users_user_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.HasConstraintName("fk_user_roles_roles_role_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("aspnetCoreReactTemplate.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_user_roles_asp_net_users_user_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("aspnetCoreReactTemplate.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_user_tokens_asp_net_users_user_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
================================================
FILE: api/Migrations/20200128145031_1580223026.cs
================================================
using Microsoft.EntityFrameworkCore.Migrations;
namespace api.Migrations
{
public partial class _1580223026 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
================================================
FILE: api/Migrations/DefaultDbContextModelSnapshot.cs
================================================
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using aspnetCoreReactTemplate.Models;
namespace api.Migrations
{
[DbContext(typeof(DefaultDbContext))]
partial class DefaultDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
.HasAnnotation("ProductVersion", "3.1.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnName("id")
.HasColumnType("text");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("concurrency_stamp")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasColumnName("normalized_name")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.HasKey("Id")
.HasName("pk_roles");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("role_name_index");
b.ToTable("roles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("ClaimType")
.HasColumnName("claim_type")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnName("claim_value")
.HasColumnType("text");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnName("role_id")
.HasColumnType("text");
b.HasKey("Id")
.HasName("pk_role_claims");
b.HasIndex("RoleId")
.HasName("ix_role_claims_role_id");
b.ToTable("role_claims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("ClaimType")
.HasColumnName("claim_type")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnName("claim_value")
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnName("user_id")
.HasColumnType("text");
b.HasKey("Id")
.HasName("pk_user_claims");
b.HasIndex("UserId")
.HasName("ix_user_claims_user_id");
b.ToTable("user_claims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnName("login_provider")
.HasColumnType("text");
b.Property<string>("ProviderKey")
.HasColumnName("provider_key")
.HasColumnType("text");
b.Property<string>("ProviderDisplayName")
.HasColumnName("provider_display_name")
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnName("user_id")
.HasColumnType("text");
b.HasKey("LoginProvider", "ProviderKey")
.HasName("pk_user_logins");
b.HasIndex("UserId")
.HasName("ix_user_logins_user_id");
b.ToTable("user_logins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnName("user_id")
.HasColumnType("text");
b.Property<string>("RoleId")
.HasColumnName("role_id")
.HasColumnType("text");
b.HasKey("UserId", "RoleId")
.HasName("pk_user_roles");
b.HasIndex("RoleId")
.HasName("ix_user_roles_role_id");
b.ToTable("user_roles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnName("user_id")
.HasColumnType("text");
b.Property<string>("LoginProvider")
.HasColumnName("login_provider")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnName("name")
.HasColumnType("text");
b.Property<string>("Value")
.HasColumnName("value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name")
.HasName("pk_user_tokens");
b.ToTable("user_tokens");
});
modelBuilder.Entity("aspnetCoreReactTemplate.Models.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnName("id")
.HasColumnType("text");
b.Property<int>("AccessFailedCount")
.HasColumnName("access_failed_count")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("concurrency_stamp")
.HasColumnType("text");
b.Property<string>("Email")
.HasColumnName("email")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.HasColumnName("email_confirmed")
.HasColumnType("boolean");
b.Property<string>("GivenName")
.HasColumnName("given_name")
.HasColumnType("text");
b.Property<bool>("LockoutEnabled")
.HasColumnName("lockout_enabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnName("lockout_end")
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasColumnName("normalized_email")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.HasColumnName("normalized_user_name")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.Property<string>("PasswordHash")
.HasColumnName("password_hash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnName("phone_number")
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnName("phone_number_confirmed")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnName("security_stamp")
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnName("two_factor_enabled")
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasColumnName("user_name")
.HasColumnType("character varying(256)")
.HasMaxLength(256);
b.HasKey("Id")
.HasName("pk_users");
b.HasIndex("NormalizedEmail")
.HasName("email_index");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("user_name_index");
b.ToTable("users");
});
modelBuilder.Entity("aspnetCoreReactTemplate.Models.Contact", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("id")
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Email")
.HasColumnName("email")
.HasColumnType("character varying(30)")
.HasMaxLength(30);
b.Property<string>("FirstName")
.IsRequired()
.HasColumnName("first_name")
.HasColumnType("text");
b.Property<string>("LastName")
.IsRequired()
.HasColumnName("last_name")
.HasColumnType("text");
b.Property<string>("Phone")
.HasColumnName("phone")
.HasColumnType("text");
b.HasKey("Id")
.HasName("pk_contacts");
b.ToTable("contacts");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.HasConstraintName("fk_role_claims_roles_role_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("aspnetCoreReactTemplate.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_user_claims_asp_net_users_user_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("aspnetCoreReactTemplate.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_user_logins_asp_net_users_user_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.HasConstraintName("fk_user_roles_roles_role_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("aspnetCoreReactTemplate.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_user_roles_asp_net_users_user_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("aspnetCoreReactTemplate.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_user_tokens_asp_net_users_user_id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
================================================
FILE: api/Models/ApplicationUser.cs
================================================
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
namespace aspnetCoreReactTemplate.Models
{
public class ApplicationUser: IdentityUser
{
public string GivenName { get; set; }
}
}
================================================
FILE: api/Models/Contact.cs
================================================
using System.ComponentModel.DataAnnotations;
namespace aspnetCoreReactTemplate.Models
{
public class Contact
{
public int Id { get; set; }
[Required]
[MinLength(3)]
public string LastName { get; set; }
[Required]
public string FirstName { get; set; }
public string Phone { get; set; }
[DataType(DataType.EmailAddress)]
[StringLength(30, MinimumLength = 0)]
public string Email { get; set; }
}
}
================================================
FILE: api/Models/DefaultDbContext.cs
================================================
using aspnetCoreReactTemplate.Extensions;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
namespace aspnetCoreReactTemplate.Models
{
public class DefaultDbContext : IdentityDbContext<ApplicationUser>
{
public DefaultDbContext(DbContextOptions<DefaultDbContext> options)
: base(options)
{
}
public DbSet<ApplicationUser> ApplicationUsers { get; set; }
public DbSet<Contact> Contacts { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
foreach (var entity in modelBuilder.Model.GetEntityTypes())
{
// Remove 'AspNet' prefix and convert table name from PascalCase to snake_case. E.g. AspNetRoleClaims -> role_claims
entity.SetTableName(entity.GetTableName().Replace("AspNet", "").ToSnakeCase());
// Convert column names from PascalCase to snake_case.
foreach (var property in entity.GetProperties())
{
property.SetColumnName(property.Name.ToSnakeCase());
}
// Convert primary key names from PascalCase to snake_case. E.g. PK_users -> pk_users
foreach (var key in entity.GetKeys())
{
key.SetName(key.GetName().ToSnakeCase());
}
// Convert foreign key names from PascalCase to snake_case.
foreach (var key in entity.GetForeignKeys())
{
key.SetConstraintName(key.GetConstraintName().ToSnakeCase());
}
// Convert index names from PascalCase to snake_case.
foreach (var index in entity.GetIndexes())
{
index.SetName(index.GetName().ToSnakeCase());
}
}
}
}
}
================================================
FILE: api/Models/DefaultDbContextInitializer.cs
================================================
using Microsoft.AspNetCore.Identity;
using System.Linq;
using System.Threading.Tasks;
namespace aspnetCoreReactTemplate.Models
{
public class DefaultDbContextInitializer : IDefaultDbContextInitializer
{
private readonly DefaultDbContext _context;
private readonly UserManager<ApplicationUser> _userManager;
private readonly RoleManager<IdentityRole> _roleManager;
public DefaultDbContextInitializer(DefaultDbContext context, UserManager<ApplicationUser> userManager, RoleManager<IdentityRole> roleManager)
{
_userManager = userManager;
_context = context;
_roleManager = roleManager;
}
public bool EnsureCreated()
{
return _context.Database.EnsureCreated();
}
public async Task Seed()
{
var email = "user@test.com";
if (await _userManager.FindByEmailAsync(email) == null)
{
var user = new ApplicationUser
{
UserName = email,
Email = email,
EmailConfirmed = true,
GivenName = "John Doe"
};
await _userManager.CreateAsync(user, "P2ssw0rd!");
}
if (_context.Contacts.Any())
{
foreach (var u in _context.Contacts)
{
_context.Remove(u);
}
}
_context.Contacts.Add(new Contact() { LastName = "Finkley", FirstName = "Adam", Phone = "555-555-5555", Email = "adam@somewhere.com" });
_context.Contacts.Add(new Contact() { LastName = "Biles", FirstName = "Steven", Phone = "555-555-5555", Email = "sbiles@somewhere.com" });
_context.SaveChanges();
}
}
public interface IDefaultDbContextInitializer
{
bool EnsureCreated();
Task Seed();
}
}
================================================
FILE: api/Models/DesignTimeDefaultDbContext.cs
================================================
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
namespace aspnetCoreReactTemplate.Models
{
public class BloggingContextFactory : IDesignTimeDbContextFactory<DefaultDbContext>
{
public DefaultDbContext CreateDbContext(string[] args)
{
var config = new ConfigurationBuilder()
.SetBasePath(System.IO.Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.Build();
var options = new DbContextOptionsBuilder<DefaultDbContext>();
options.UseNpgsql(config.GetConnectionString("defaultConnection"));
return new DefaultDbContext(options.Options);
}
}
}
================================================
FILE: api/NuGet.Config
================================================
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<add key="aspnet-contrib" value="https://www.myget.org/F/aspnet-contrib/api/v3/index.json" />
</packageSources>
</configuration>
================================================
FILE: api/Program.cs
================================================
using System.IO;
using aspnetCoreReactTemplate.Models;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace aspnetCoreReactTemplate
{
public class Program
{
public static void Main(string[] args)
{
var config = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.Build();
var host = CreateHostBuilder(config, args).Build();
using (var scope = host.Services.CreateScope())
{
var dbContext = scope.ServiceProvider.GetService<DefaultDbContext>();
dbContext.Database.Migrate();
var env = scope.ServiceProvider.GetRequiredService<IWebHostEnvironment>();
if (env.IsDevelopment())
{
// Seed the database in development mode
var dbInitializer = scope.ServiceProvider.GetRequiredService<Models.IDefaultDbContextInitializer>();
dbInitializer.Seed().GetAwaiter().GetResult();
}
}
host.Run();
}
public static IHostBuilder CreateHostBuilder(IConfigurationRoot config, string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureLogging(logging =>
{
logging.ClearProviders();
// Log to console (stdout) - in production stdout will be written to /var/log/{{app_name}}.out.log
logging.AddConsole();
logging.AddDebug();
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder
.UseUrls(config["serverBindingUrl"])
.UseStartup<Startup>();
});
}
}
================================================
FILE: api/Properties/launchSettings.json
================================================
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:5000/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "http://localhost:5000",
"environmentVariables": {
"NODE_PATH": "../node_modules/",
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"api": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"NODE_PATH": "../node_modules/",
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:5000/"
}
}
}
================================================
FILE: api/Services/EmailSender.cs
================================================
using System.Net;
using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
namespace aspnetCoreReactTemplate.Services
{
public class EmailSender : IEmailSender
{
public EmailSender(IOptions<EmailSenderOptions> optionsAccessor)
{
Options = optionsAccessor.Value;
}
public EmailSenderOptions Options { get; }
public async Task SendEmailAsync(string toEmail, string subject, string htmlMessage, string textMessage = null)
{
MailMessage mailMessage = new MailMessage();
mailMessage.From = new MailAddress(this.Options.emailFromAddress, this.Options.emailFromName);
mailMessage.To.Add(toEmail);
mailMessage.Body = textMessage;
mailMessage.BodyEncoding = Encoding.UTF8;
mailMessage.Subject = subject;
mailMessage.SubjectEncoding = Encoding.UTF8;
if (!string.IsNullOrEmpty(htmlMessage))
{
AlternateView htmlView = AlternateView.CreateAlternateViewFromString(htmlMessage);
htmlView.ContentType = new System.Net.Mime.ContentType("text/html");
mailMessage.AlternateViews.Add(htmlView);
}
using (SmtpClient client = new SmtpClient(this.Options.host, this.Options.port))
{
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential(this.Options.username, this.Options.password);
client.EnableSsl = this.Options.enableSSL;
await client.SendMailAsync(mailMessage);
}
}
}
}
================================================
FILE: api/Services/EmailSenderOptions.cs
================================================
using System;
using System.Text.RegularExpressions;
namespace aspnetCoreReactTemplate.Services
{
public class EmailSenderOptions
{
private string _smtpConfig { get; set; }
public string smtpConfig
{
get { return this._smtpConfig; }
set
{
this._smtpConfig = value;
// smtpConfig is in username:password@localhost:1025 format; extract the part
var smtpConfigPartsRegEx = new Regex(@"(.*)\:(.*)@(.+)\:(.+)");
var smtpConfigPartsMatch = smtpConfigPartsRegEx.Match(value);
this.username = smtpConfigPartsMatch.Groups[1].Value;
this.password = smtpConfigPartsMatch.Groups[2].Value;
this.host = smtpConfigPartsMatch.Groups[3].Value;
this.port = Convert.ToInt32(smtpConfigPartsMatch.Groups[4].Value);
}
}
public string emailFromName { get; set; }
public string emailFromAddress { get; set; }
public bool enableSSL { get; set; }
public string username { get; protected set; }
public string password { get; protected set; }
public string host { get; protected set; }
public int port { get; protected set; }
}
}
================================================
FILE: api/Services/IEmailSender.cs
================================================
using System.Threading.Tasks;
namespace aspnetCoreReactTemplate.Services
{
public interface IEmailSender
{
Task SendEmailAsync(string toEmail, string subject, string htmlMessage, string textMessage = null);
}
}
================================================
FILE: api/Services/JwtOptions.cs
================================================
using System;
using System.Text.RegularExpressions;
namespace aspnetCoreReactTemplate.Services
{
public class JwtOptions
{
public string key { get; set; }
public string issuer { get; set; }
}
}
================================================
FILE: api/Startup.cs
================================================
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore;
using aspnetCoreReactTemplate.Models;
using aspnetCoreReactTemplate.Services;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens;
using Microsoft.Extensions.Hosting;
using System.Text;
namespace aspnetCoreReactTemplate
{
public class Startup
{
public IHostEnvironment CurrentEnvironment { get; protected set; }
public IConfiguration Configuration { get; }
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews();
services.AddEntityFrameworkNpgsql().AddDbContext<DefaultDbContext>(options =>
{
options.UseNpgsql(Configuration.GetConnectionString("defaultConnection"));
});
// Configure Entity Framework Initializer for seeding
services.AddTransient<IDefaultDbContextInitializer, DefaultDbContextInitializer>();
services.AddDatabaseDeveloperPageExceptionFilter();
// Configure Entity Framework Identity for Auth
services.AddIdentity<ApplicationUser, IdentityRole>()
.AddEntityFrameworkStores<DefaultDbContext>()
.AddDefaultTokenProviders();
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
})
.AddJwtBearer(config =>
{
config.RequireHttpsMetadata = false;
config.SaveToken = true;
config.TokenValidationParameters = new TokenValidationParameters()
{
ValidIssuer = Configuration["jwt:issuer"],
ValidAudience = Configuration["jwt:issuer"],
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["jwt:key"]))
};
});
services.AddTransient<IEmailSender, EmailSender>();
services.Configure<EmailSenderOptions>(Configuration.GetSection("email"));
services.Configure<JwtOptions>(Configuration.GetSection("jwt"));
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostEnvironment env, ILoggerFactory loggerFactory)
{
// If not requesting /api*, rewrite to / so SPA app will be returned
app.UseSpaFallback(new SpaFallbackOptions()
{
ApiPathPrefix = "/api",
RewritePath = "/"
});
app.UseDefaultFiles();
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
// Read and use headers coming from reverse proxy: X-Forwarded-For X-Forwarded-Proto
// This is particularly important so that HttpContet.Request.Scheme will be correct behind a SSL terminating proxy
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});
if (env.IsDevelopment())
{
app.UseSpa(spa =>
{
spa.UseProxyToSpaDevelopmentServer("http://localhost:8080/");
});
app.UseDeveloperExceptionPage();
app.UseMigrationsEndPoint();
}
}
}
}
================================================
FILE: api/ViewModels/ConfirmEmail.cs
================================================
namespace aspnetCoreReactTemplate.ViewModels
{
public class ConfirmEmail
{
public string user_id { get; set; }
public string token { get; set; }
}
}
================================================
FILE: api/ViewModels/NewUser.cs
================================================
using System.ComponentModel.DataAnnotations;
namespace aspnetCoreReactTemplate.ViewModels
{
public class NewUser
{
[Required]
[EmailAddress]
public string username { get; set; }
[Required]
[MinLength(8)]
public string password { get; set; }
}
}
================================================
FILE: api/api.csproj
================================================
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="5.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.9" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="5.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.9">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.9" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.7" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot" />
</ItemGroup>
</Project>
================================================
FILE: api/appsettings.json
================================================
{
"connectionStrings": {
"defaultConnection": "Host=localhost;Port=5433;Username=postgres;Password=postgres;Database=dotnetcore"
},
"frontEndUrl": "http://localhost:5000",
"serverBindingUrl": "http://0.0.0.0:5000",
"logging": {
"includeScopes": false,
"logLevel": {
"default": "Debug",
"system": "Information",
"microsoft": "Information"
}
},
"webClientPath": "../client-react",
"jwt": {
"key" : "2af4ff57-4ca0-4b3a-804b-178ad27aaf88",
"issuer": "aspnet-core-react-template"
},
"email": {
"smtpConfig": ":@localhost:1025",
"enableSSL": false,
"emailFromName": "aspnet-core-react-template",
"emailFromAddress": "noreply@aspnet-core-react-template.com"
}
}
================================================
FILE: api/log/development-20170420.log
================================================
2017-04-20T11:35:30.8306170-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:30.8800930-05:00 [INF] Executed DbCommand (14ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:35:30.8820010-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:30.8946950-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:30.8966570-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:35:30.8967560-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:30.9031950-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:30.9049280-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId"; (6438bdd5)
2017-04-20T11:35:30.9054630-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:31.3218430-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:31.5298490-05:00 [INF] Executed DbCommand (77ms) [Parameters=[@__normalizedEmail_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedEmail" = @__normalizedEmail_0
LIMIT 1 (6438bdd5)
2017-04-20T11:35:31.5958230-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:31.6509440-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:31.6571590-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM "Contacts" AS "c")
THEN TRUE::bool ELSE FALSE::bool
END (6438bdd5)
2017-04-20T11:35:31.6583500-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:31.6775930-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:31.6789170-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "c"."contactId", "c"."email", "c"."name", "c"."phone"
FROM "Contacts" AS "c" (6438bdd5)
2017-04-20T11:35:31.7076610-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:31.7669820-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:31.7728150-05:00 [DBG] Beginning transaction with isolation level 'Unspecified'. (3b5ca34b)
2017-04-20T11:35:31.8349080-05:00 [INF] Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30']
DELETE FROM "Contacts"
WHERE "contactId" = @p0;
DELETE FROM "Contacts"
WHERE "contactId" = @p1;
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p2, @p3, @p4)
RETURNING "contactId";
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p5, @p6, @p7)
RETURNING "contactId"; (6438bdd5)
2017-04-20T11:35:31.8603320-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:35:33.0652850-05:00 [INF] ts-loader: Using typescript@2.2.2 and /Users/bholt/dev/aspnet-core-react-template/client-react/tsconfig.json (114b565e)
2017-04-20T11:35:33.0802850-05:00 [DBG] Hosting starting (32b26330)
2017-04-20T11:35:33.1537040-05:00 [DBG] Hosting started (e6def423)
2017-04-20T11:35:37.9044370-05:00 [INF] webpack built d5ef16186ce4d979a8ac in 5087ms (83001040)
2017-04-20T11:35:43.1417480-05:00 [DBG] Connection id ""0HL481D4TQDAN"" started. (1426b994)
2017-04-20T11:35:43.2379250-05:00 0HL481D4URNUT [INF] Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr (e5be5b71)
2017-04-20T11:36:11.8277120-05:00 [DBG] Connection id ""0HL481D4TQDAQ"" started. (1426b994)
2017-04-20T11:36:11.8277120-05:00 [DBG] Connection id ""0HL481D4TQDAP"" started. (1426b994)
2017-04-20T11:36:11.8277120-05:00 [DBG] Connection id ""0HL481D4TQDAO"" started. (1426b994)
2017-04-20T11:36:11.8279810-05:00 [DBG] Connection id ""0HL481D4TQDAR"" started. (1426b994)
2017-04-20T11:36:11.8280120-05:00 [DBG] Connection id ""0HL481D4TQDAS"" started. (1426b994)
2017-04-20T11:36:11.9435780-05:00 0HL481D4URNUU [INF] Request starting HTTP/1.1 GET http://localhost:5000/sign-in/?expired=1 (e5be5b71)
2017-04-20T11:36:11.9719460-05:00 0HL481D4URNUU [INF] Handling request: /sign-in/ (6455a65b)
2017-04-20T11:36:11.9724410-05:00 0HL481D4URNUU [INF] Rewriting path: /sign-in/ > / (170f1f87)
2017-04-20T11:36:12.0015370-05:00 0HL481D4URNUU [INF] Sending file. Request path: '"/index.html"'. Physical path: '"/Users/bholt/dev/aspnet-core-react-template/api/wwwroot/index.html"' (27b0a520)
2017-04-20T11:36:12.0271890-05:00 0HL481D4URNUU [INF] Finished handling request. (d2c25297)
2017-04-20T11:36:12.0277690-05:00 [DBG] Connection id ""0HL481D4TQDAN"" received FIN. (acf58720)
2017-04-20T11:36:12.0336340-05:00 0HL481D4URNUU [DBG] Connection id ""0HL481D4TQDAP"" completed keep alive response. (9784cde9)
2017-04-20T11:36:12.0426020-05:00 0HL481D4URNUU [INF] Request finished in 91.3023ms 200 text/html (15c52c40)
2017-04-20T11:36:12.0500360-05:00 0HL481D4URNUV [INF] Request starting HTTP/1.1 GET http://localhost:5000/main.js (e5be5b71)
2017-04-20T11:36:12.1321120-05:00 0HL481D4URNUV [DBG] Connection id ""0HL481D4TQDAP"" completed keep alive response. (9784cde9)
2017-04-20T11:36:12.1322260-05:00 0HL481D4URNUV [INF] Request finished in 82.2472ms 200 application/javascript; charset=UTF-8 (15c52c40)
2017-04-20T11:36:12.2905320-05:00 0HL481D4URNV0 [INF] Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr (e5be5b71)
2017-04-20T11:36:12.3184020-05:00 [INF] Connection id ""0HL481D4TQDAN"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe
2017-04-20T11:36:12.3195980-05:00 [DBG] Connection id ""0HL481D4TQDAN"" disconnecting. (b29b9868)
2017-04-20T11:36:12.3227210-05:00 [DBG] Connection id ""0HL481D4TQDAN"" stopped. (056149f8)
2017-04-20T11:36:14.4920170-05:00 [DBG] Connection id ""0HL481D4TQDAT"" started. (1426b994)
2017-04-20T11:36:14.5987070-05:00 0HL481D4URNV1 [INF] Request starting HTTP/1.1 GET http://localhost:5000/sign-in/?expired=1 (e5be5b71)
2017-04-20T11:36:14.6008020-05:00 0HL481D4URNV1 [INF] Handling request: /sign-in/ (6455a65b)
2017-04-20T11:36:14.6009470-05:00 0HL481D4URNV1 [INF] Rewriting path: /sign-in/ > / (170f1f87)
2017-04-20T11:36:14.6015570-05:00 0HL481D4URNV1 [INF] The file "/index.html" was not modified (f1f8d725)
2017-04-20T11:36:14.6052500-05:00 0HL481D4URNV1 [DBG] Handled. Status code: 304 File: "/index.html" (58f8d392)
2017-04-20T11:36:14.6059120-05:00 0HL481D4URNV1 [INF] Finished handling request. (d2c25297)
2017-04-20T11:36:14.6082100-05:00 0HL481D4URNV1 [DBG] Connection id ""0HL481D4TQDAQ"" completed keep alive response. (9784cde9)
2017-04-20T11:36:14.6083090-05:00 0HL481D4URNV1 [INF] Request finished in 9.6036ms 304 text/html (15c52c40)
2017-04-20T11:36:14.6105660-05:00 [DBG] Connection id ""0HL481D4TQDAP"" received FIN. (acf58720)
2017-04-20T11:36:14.6150570-05:00 0HL481D4URNV2 [INF] Request starting HTTP/1.1 GET http://localhost:5000/main.js (e5be5b71)
2017-04-20T11:36:14.6490190-05:00 0HL481D4URNV2 [DBG] Connection id ""0HL481D4TQDAQ"" completed keep alive response. (9784cde9)
2017-04-20T11:36:14.6491170-05:00 0HL481D4URNV2 [INF] Request finished in 34.0525ms 200 application/javascript; charset=UTF-8 (15c52c40)
2017-04-20T11:36:14.7931650-05:00 0HL481D4URNV3 [INF] Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr (e5be5b71)
2017-04-20T11:36:14.8183730-05:00 [INF] Connection id ""0HL481D4TQDAP"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe
2017-04-20T11:36:14.8184200-05:00 [DBG] Connection id ""0HL481D4TQDAP"" disconnecting. (b29b9868)
2017-04-20T11:36:14.8185990-05:00 [DBG] Connection id ""0HL481D4TQDAP"" stopped. (056149f8)
2017-04-20T11:36:31.0322080-05:00 [INF] Received SIGINT. Waiting for .NET process to exit... (39e2bf0e)
2017-04-20T11:36:31.0363300-05:00 [DBG] Hosting shutdown (49005419)
2017-04-20T11:36:42.5679710-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:42.6172200-05:00 [INF] Executed DbCommand (13ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:36:42.6190720-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:42.6324510-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:42.6352190-05:00 [INF] Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:36:42.6353160-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:42.6419620-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:42.6434930-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId"; (6438bdd5)
2017-04-20T11:36:42.6440570-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:43.0661490-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:43.2727970-05:00 [INF] Executed DbCommand (72ms) [Parameters=[@__normalizedEmail_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedEmail" = @__normalizedEmail_0
LIMIT 1 (6438bdd5)
2017-04-20T11:36:43.3405580-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:43.3952030-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:43.4003370-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM "Contacts" AS "c")
THEN TRUE::bool ELSE FALSE::bool
END (6438bdd5)
2017-04-20T11:36:43.4014950-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:43.4214390-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:43.4230960-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "c"."contactId", "c"."email", "c"."name", "c"."phone"
FROM "Contacts" AS "c" (6438bdd5)
2017-04-20T11:36:43.4509720-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:43.5138800-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:43.5196070-05:00 [DBG] Beginning transaction with isolation level 'Unspecified'. (3b5ca34b)
2017-04-20T11:36:43.5970100-05:00 [INF] Executed DbCommand (6ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30']
DELETE FROM "Contacts"
WHERE "contactId" = @p0;
DELETE FROM "Contacts"
WHERE "contactId" = @p1;
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p2, @p3, @p4)
RETURNING "contactId";
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p5, @p6, @p7)
RETURNING "contactId"; (6438bdd5)
2017-04-20T11:36:43.6252790-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:36:44.8000390-05:00 [INF] ts-loader: Using typescript@2.2.2 and /Users/bholt/dev/aspnet-core-react-template/client-react/tsconfig.json (114b565e)
2017-04-20T11:36:44.8266520-05:00 [DBG] Hosting starting (32b26330)
2017-04-20T11:36:44.9005150-05:00 [DBG] Hosting started (e6def423)
2017-04-20T11:36:46.9926100-05:00 [DBG] Connection id ""0HL481DNUOBGO"" started. (1426b994)
2017-04-20T11:36:46.9926270-05:00 [DBG] Connection id ""0HL481DNUOBGL"" started. (1426b994)
2017-04-20T11:36:46.9926370-05:00 [DBG] Connection id ""0HL481DNUOBGN"" started. (1426b994)
2017-04-20T11:36:46.9926430-05:00 [DBG] Connection id ""0HL481DNUOBGM"" started. (1426b994)
2017-04-20T11:36:46.9982000-05:00 [DBG] Connection id ""0HL481DNUOBGQ"" started. (1426b994)
2017-04-20T11:36:46.9982010-05:00 [DBG] Connection id ""0HL481DNUOBGP"" started. (1426b994)
2017-04-20T11:36:47.1680840-05:00 0HL481DO0HIUT [INF] Request starting HTTP/1.1 GET http://localhost:5000/sign-in/?expired=1 (e5be5b71)
2017-04-20T11:36:49.6840130-05:00 [INF] webpack built d5ef16186ce4d979a8ac in 5127ms (d4c9e226)
2017-04-20T11:36:49.8292910-05:00 0HL481DO0HIUT [INF] Handling request: /sign-in/ (6455a65b)
2017-04-20T11:36:49.8316730-05:00 0HL481DO0HIUT [INF] Rewriting path: /sign-in/ > / (170f1f87)
2017-04-20T11:36:49.8673890-05:00 0HL481DO0HIUT [INF] Sending file. Request path: '"/index.html"'. Physical path: '"/Users/bholt/dev/aspnet-core-react-template/api/wwwroot/index.html"' (27b0a520)
2017-04-20T11:36:49.9422540-05:00 0HL481DO0HIUT [INF] Finished handling request. (d2c25297)
2017-04-20T11:36:49.9487830-05:00 0HL481DO0HIUT [DBG] Connection id ""0HL481DNUOBGO"" completed keep alive response. (9784cde9)
2017-04-20T11:36:49.9574050-05:00 0HL481DO0HIUT [INF] Request finished in 2803.0445ms 200 text/html (15c52c40)
2017-04-20T11:36:49.9652020-05:00 0HL481DO0HIUU [INF] Request starting HTTP/1.1 GET http://localhost:5000/main.js (e5be5b71)
2017-04-20T11:36:50.0631710-05:00 0HL481DO0HIUU [DBG] Connection id ""0HL481DNUOBGO"" completed keep alive response. (9784cde9)
2017-04-20T11:36:50.0633730-05:00 0HL481DO0HIUU [INF] Request finished in 98.145ms 200 application/javascript; charset=UTF-8 (15c52c40)
2017-04-20T11:36:50.2230400-05:00 0HL481DO0HIUV [INF] Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr (e5be5b71)
2017-04-20T11:37:43.9188350-05:00 [DBG] Connection id ""0HL481DNUOBGL"" received FIN. (acf58720)
2017-04-20T11:37:43.9188350-05:00 [DBG] Connection id ""0HL481DNUOBGP"" received FIN. (acf58720)
2017-04-20T11:37:43.9188350-05:00 [DBG] Connection id ""0HL481DNUOBGM"" received FIN. (acf58720)
2017-04-20T11:37:43.9189140-05:00 [DBG] Connection id ""0HL481DNUOBGN"" received FIN. (acf58720)
2017-04-20T11:37:43.9190380-05:00 [DBG] Connection id ""0HL481DNUOBGQ"" received FIN. (acf58720)
2017-04-20T11:37:43.9191040-05:00 [DBG] Connection id ""0HL481DNUOBGR"" started. (1426b994)
2017-04-20T11:37:43.9193680-05:00 [DBG] Connection id ""0HL481DNUOBGS"" started. (1426b994)
2017-04-20T11:37:43.9195950-05:00 [DBG] Connection id ""0HL481DNUOBGP"" disconnecting. (b29b9868)
2017-04-20T11:37:43.9196100-05:00 [DBG] Connection id ""0HL481DNUOBGL"" disconnecting. (b29b9868)
2017-04-20T11:37:43.9196140-05:00 [DBG] Connection id ""0HL481DNUOBGT"" started. (1426b994)
2017-04-20T11:37:43.9196310-05:00 [DBG] Connection id ""0HL481DNUOBGQ"" disconnecting. (b29b9868)
2017-04-20T11:37:43.9196490-05:00 [DBG] Connection id ""0HL481DNUOBGU"" started. (1426b994)
2017-04-20T11:37:43.9196590-05:00 [DBG] Connection id ""0HL481DNUOBGM"" disconnecting. (b29b9868)
2017-04-20T11:37:43.9196950-05:00 [DBG] Connection id ""0HL481DNUOBGN"" disconnecting. (b29b9868)
2017-04-20T11:37:43.9231050-05:00 [DBG] Connection id ""0HL481DNUOBGQ"" sending FIN. (ffb251f5)
2017-04-20T11:37:43.9230940-05:00 [DBG] Connection id ""0HL481DNUOBGN"" sending FIN. (ffb251f5)
2017-04-20T11:37:43.9230990-05:00 [DBG] Connection id ""0HL481DNUOBGP"" sending FIN. (ffb251f5)
2017-04-20T11:37:43.9231120-05:00 [DBG] Connection id ""0HL481DNUOBGL"" sending FIN. (ffb251f5)
2017-04-20T11:37:43.9246720-05:00 [DBG] Connection id ""0HL481DNUOBGM"" sending FIN. (ffb251f5)
2017-04-20T11:37:43.9286220-05:00 [DBG] Connection id ""0HL481DNUOBGP"" sent FIN with status "0". (69d90ca7)
2017-04-20T11:37:43.9286400-05:00 [DBG] Connection id ""0HL481DNUOBGN"" sent FIN with status "0". (69d90ca7)
2017-04-20T11:37:43.9286180-05:00 [DBG] Connection id ""0HL481DNUOBGL"" sent FIN with status "0". (69d90ca7)
2017-04-20T11:37:43.9286460-05:00 [DBG] Connection id ""0HL481DNUOBGQ"" sent FIN with status "0". (69d90ca7)
2017-04-20T11:37:43.9320710-05:00 [DBG] Connection id ""0HL481DNUOBGN"" stopped. (056149f8)
2017-04-20T11:37:43.9320770-05:00 [DBG] Connection id ""0HL481DNUOBGL"" stopped. (056149f8)
2017-04-20T11:37:43.9320710-05:00 [DBG] Connection id ""0HL481DNUOBGQ"" stopped. (056149f8)
2017-04-20T11:37:43.9320710-05:00 [DBG] Connection id ""0HL481DNUOBGP"" stopped. (056149f8)
2017-04-20T11:37:43.9322520-05:00 [DBG] Connection id ""0HL481DNUOBGM"" sent FIN with status "0". (69d90ca7)
2017-04-20T11:37:43.9324070-05:00 [DBG] Connection id ""0HL481DNUOBGM"" stopped. (056149f8)
2017-04-20T11:37:44.0243850-05:00 0HL481DO0HIV0 [INF] Request starting HTTP/1.1 GET http://localhost:5000/sign-in/?expired=1 (e5be5b71)
2017-04-20T11:37:44.0274720-05:00 0HL481DO0HIV0 [INF] Handling request: /sign-in/ (6455a65b)
2017-04-20T11:37:44.0276610-05:00 0HL481DO0HIV0 [INF] Rewriting path: /sign-in/ > / (170f1f87)
2017-04-20T11:37:44.0291950-05:00 0HL481DO0HIV0 [INF] The file "/index.html" was not modified (f1f8d725)
2017-04-20T11:37:44.0335380-05:00 0HL481DO0HIV0 [DBG] Handled. Status code: 304 File: "/index.html" (58f8d392)
2017-04-20T11:37:44.0340220-05:00 0HL481DO0HIV0 [INF] Finished handling request. (d2c25297)
2017-04-20T11:37:44.0364350-05:00 0HL481DO0HIV0 [DBG] Connection id ""0HL481DNUOBGR"" completed keep alive response. (9784cde9)
2017-04-20T11:37:44.0365290-05:00 0HL481DO0HIV0 [INF] Request finished in 12.181ms 304 text/html (15c52c40)
2017-04-20T11:37:44.0387160-05:00 [DBG] Connection id ""0HL481DNUOBGO"" received FIN. (acf58720)
2017-04-20T11:37:44.0447030-05:00 0HL481DO0HIV1 [INF] Request starting HTTP/1.1 GET http://localhost:5000/main.js (e5be5b71)
2017-04-20T11:37:44.1497720-05:00 0HL481DO0HIV1 [DBG] Connection id ""0HL481DNUOBGR"" completed keep alive response. (9784cde9)
2017-04-20T11:37:44.1499180-05:00 0HL481DO0HIV1 [INF] Request finished in 105.2445ms 200 application/javascript; charset=UTF-8 (15c52c40)
2017-04-20T11:37:44.3064100-05:00 0HL481DO0HIV2 [INF] Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr (e5be5b71)
2017-04-20T11:37:44.3697020-05:00 [INF] Connection id ""0HL481DNUOBGO"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe
2017-04-20T11:37:44.3706480-05:00 [DBG] Connection id ""0HL481DNUOBGO"" disconnecting. (b29b9868)
2017-04-20T11:37:44.3707470-05:00 [DBG] Connection id ""0HL481DNUOBGO"" stopped. (056149f8)
2017-04-20T11:37:44.7403160-05:00 0HL481DO0HIV3 [INF] Request starting HTTP/1.1 GET http://localhost:5000/sign-in/?expired=1 (e5be5b71)
2017-04-20T11:37:44.7441180-05:00 0HL481DO0HIV3 [INF] Handling request: /sign-in/ (6455a65b)
2017-04-20T11:37:44.7443270-05:00 0HL481DO0HIV3 [INF] Rewriting path: /sign-in/ > / (170f1f87)
2017-04-20T11:37:44.7445570-05:00 0HL481DO0HIV3 [INF] The file "/index.html" was not modified (f1f8d725)
2017-04-20T11:37:44.7447200-05:00 0HL481DO0HIV3 [DBG] Handled. Status code: 304 File: "/index.html" (58f8d392)
2017-04-20T11:37:44.7447680-05:00 0HL481DO0HIV3 [INF] Finished handling request. (d2c25297)
2017-04-20T11:37:44.7449150-05:00 0HL481DO0HIV3 [DBG] Connection id ""0HL481DNUOBGS"" completed keep alive response. (9784cde9)
2017-04-20T11:37:44.7449890-05:00 0HL481DO0HIV3 [INF] Request finished in 4.8109ms 304 text/html (15c52c40)
2017-04-20T11:37:44.7472770-05:00 [DBG] Connection id ""0HL481DNUOBGR"" received FIN. (acf58720)
2017-04-20T11:37:44.7519900-05:00 0HL481DO0HIV4 [INF] Request starting HTTP/1.1 GET http://localhost:5000/main.js (e5be5b71)
2017-04-20T11:37:44.7881250-05:00 0HL481DO0HIV4 [DBG] Connection id ""0HL481DNUOBGS"" completed keep alive response. (9784cde9)
2017-04-20T11:37:44.7882510-05:00 0HL481DO0HIV4 [INF] Request finished in 36.2429ms 200 application/javascript; charset=UTF-8 (15c52c40)
2017-04-20T11:37:44.9357150-05:00 0HL481DO0HIV5 [INF] Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr (e5be5b71)
2017-04-20T11:37:45.0186840-05:00 [INF] Connection id ""0HL481DNUOBGR"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe
2017-04-20T11:37:45.0187000-05:00 [DBG] Connection id ""0HL481DNUOBGR"" disconnecting. (b29b9868)
2017-04-20T11:37:45.0188670-05:00 [DBG] Connection id ""0HL481DNUOBGR"" stopped. (056149f8)
2017-04-20T11:37:47.8385420-05:00 [DBG] Connection id ""0HL481DNUOBGV"" started. (1426b994)
2017-04-20T11:37:47.8391390-05:00 0HL481DO0HIV6 [INF] Request starting HTTP/1.1 POST http://localhost:5000/api/auth/register application/x-www-form-urlencoded 41 (e5be5b71)
2017-04-20T11:37:47.8441730-05:00 0HL481DO0HIV6 [INF] Handling request: /api/auth/register (2c1017b8)
2017-04-20T11:37:47.8450270-05:00 0HL481DO0HIV6 [DBG] "POST" requests are not supported (1c759b4c)
2017-04-20T11:37:47.8782690-05:00 0HL481DO0HIV6 [INF] "Bearer" was not authenticated. Failure message: "Authentication failed because the access token was invalid." (48071232)
2017-04-20T11:37:47.9079750-05:00 [DBG] Connection id ""0HL481DNUOBH0"" started. (1426b994)
2017-04-20T11:37:47.9081840-05:00 0HL481DO0HIV7 [INF] Request starting HTTP/1.1 GET http://localhost:5000/.well-known/openid-configuration (e5be5b71)
2017-04-20T11:37:47.9112280-05:00 0HL481DO0HIV7 [INF] Handling request: /.well-known/openid-configuration (28f0d040)
2017-04-20T11:37:47.9124590-05:00 0HL481DO0HIV7 [DBG] The request path "/.well-known/openid-configuration" does not match a supported file type (4910e68e)
2017-04-20T11:37:47.9129630-05:00 0HL481DO0HIV7 [DBG] Authentication was skipped because no bearer token was received. (9de85986)
2017-04-20T11:37:47.9604730-05:00 0HL481DO0HIV7 [INF] The discovery request was successfully extracted from the HTTP request: "{}" (8eb39e75)
2017-04-20T11:37:47.9609200-05:00 0HL481DO0HIV7 [INF] The discovery request was successfully validated. (5773bc23)
2017-04-20T11:37:47.9968510-05:00 0HL481DO0HIV7 [INF] The discovery response was successfully returned: "{
\"issuer\": \"http://localhost:5000/\",
\"token_endpoint\": \"http://localhost:5000/api/auth/login\",
\"jwks_uri\": \"http://localhost:5000/.well-known/jwks\",
\"grant_types_supported\": [
\"refresh_token\",
\"password\"
],
\"scopes_supported\": [
\"openid\",
\"profile\",
\"email\",
\"phone\",
\"roles\",
\"offline_access\"
],
\"id_token_signing_alg_values_supported\": [
\"RS256\"
],
\"subject_types_supported\": [
\"public\"
],
\"token_endpoint_auth_methods_supported\": [
\"client_secret_basic\",
\"client_secret_post\"
]
}" (ee57d974)
2017-04-20T11:37:48.0282260-05:00 0HL481DO0HIV7 [INF] Finished handling request. (d2c25297)
2017-04-20T11:37:48.0298620-05:00 0HL481DO0HIV7 [DBG] Connection id ""0HL481DNUOBH0"" completed keep alive response. (9784cde9)
2017-04-20T11:37:48.0299690-05:00 0HL481DO0HIV7 [INF] Request finished in 121.8068ms 200 application/json;charset=UTF-8 (15c52c40)
2017-04-20T11:37:48.0480060-05:00 0HL481DO0HIV8 [INF] Request starting HTTP/1.1 GET http://localhost:5000/.well-known/jwks (e5be5b71)
2017-04-20T11:37:48.0506240-05:00 0HL481DO0HIV8 [INF] Handling request: /.well-known/jwks (3092411e)
2017-04-20T11:37:48.0509020-05:00 0HL481DO0HIV8 [DBG] The request path "/.well-known/jwks" does not match a supported file type (4910e68e)
2017-04-20T11:37:48.0509530-05:00 0HL481DO0HIV8 [DBG] Authentication was skipped because no bearer token was received. (9de85986)
2017-04-20T11:37:48.0668590-05:00 0HL481DO0HIV8 [INF] The discovery request was successfully extracted from the HTTP request: "{}" (8eb39e75)
2017-04-20T11:37:48.0733790-05:00 0HL481DO0HIV8 [INF] The discovery response was successfully returned: "{
\"keys\": [
{
\"kid\": \"ZINIJNEZDR5SICRGXFCAQ2N2M0GJHODRC_YSGCBP\",
\"use\": \"sig\",
\"kty\": \"RSA\",
\"alg\": \"RS256\",
\"e\": \"AQAB\",
\"n\": \"ziNiJnezDr5SIcRGXFcaQ2n2M0gjhODRc_YSgcbPrt1X3JZ7VSIo1RvPH1P1v37GV5nvF-B4QTTV2I8ZOyPa8OIY9j0qPl5DMEDO8iavf2pMdBjxA5JI_fO1EO-eZRojPtHFrE-dbnt8AOWNgqx3okN5Js-odWL3pg3TybsENv_lxFk3K4v7zlF7-J7gdlqDKTjgoRfU2OzxgOvEAIGQ66hy8alXn8IjJJ1sPBsw77r6ij7jOs1TB6YjE1ZMzRs-jUm4cR8Q2q7vzPHEgelM61sjW9Gac0NTLgS6UNCnNTBYebum1Q-HVhdCJCZ8VDq6R7iWlm-8NeoGT78EC4pLbQ\"
}
]
}" (ee57d974)
2017-04-20T11:37:48.0735570-05:00 0HL481DO0HIV8 [INF] Finished handling request. (d2c25297)
2017-04-20T11:37:48.0736820-05:00 0HL481DO0HIV8 [DBG] Connection id ""0HL481DNUOBH0"" completed keep alive response. (9784cde9)
2017-04-20T11:37:48.0737980-05:00 0HL481DO0HIV8 [INF] Request finished in 25.7882ms 200 application/json;charset=UTF-8 (15c52c40)
2017-04-20T11:37:48.0922480-05:00 0HL481DO0HIV6 [INF] "Bearer" was not authenticated. Failure message: "No SecurityTokenValidator available for token: null" (48071232)
2017-04-20T11:37:48.3252880-05:00 0HL481DO0HIV6 [DBG] Request successfully matched the route with name 'null' and template '"api/auth/register"'. (555ac2ba)
2017-04-20T11:37:48.3736270-05:00 0HL481DO0HIV6 [DBG] Executing action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" (3f3ef15a)
2017-04-20T11:37:48.6162920-05:00 0HL481DO0HIV6 [INF] Executing action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" with arguments (["aspnetCoreReactTemplate.ViewModels.NewUser"]) - ModelState is Valid (ba7f4ac2)
2017-04-20T11:37:48.7035500-05:00 0HL481DO0HIV6 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:37:48.7151230-05:00 0HL481DO0HIV6 [INF] Executed DbCommand (10ms) [Parameters=[@__normalizedUserName_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedUserName" = @__normalizedUserName_0
LIMIT 1 (6438bdd5)
2017-04-20T11:37:48.7158920-05:00 0HL481DO0HIV6 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:37:48.7245730-05:00 0HL481DO0HIV6 [WRN] User "9bf02c6f-6f89-4282-8ac3-4489462861ad" validation failed: "DuplicateUserName". (5dc28e15)
2017-04-20T11:37:48.7274430-05:00 0HL481DO0HIV6 [DBG] Executed action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)", returned result "Microsoft.AspNetCore.Mvc.BadRequestObjectResult". (f72615e0)
2017-04-20T11:37:48.7497940-05:00 0HL481DO0HIV6 [DBG] No information found on request to perform content negotiation. (6aec0ec5)
2017-04-20T11:37:48.7547650-05:00 0HL481DO0HIV6 [DBG] Selected output formatter '"Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter"' and content type '"application/json"' to write the response. (fcc32779)
2017-04-20T11:37:48.7550900-05:00 0HL481DO0HIV6 [INF] Executing ObjectResult, writing value "Microsoft.AspNetCore.Mvc.ControllerContext". (4e968210)
2017-04-20T11:37:48.7902840-05:00 0HL481DO0HIV6 [INF] Executed action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" in 412.9491ms (afa2e885)
2017-04-20T11:37:48.7915380-05:00 0HL481DO0HIV6 [INF] Finished handling request. (d2c25297)
2017-04-20T11:37:48.7952490-05:00 0HL481DO0HIV6 [DBG] Connection id ""0HL481DNUOBGV"" completed keep alive response. (9784cde9)
2017-04-20T11:37:48.7953670-05:00 0HL481DO0HIV6 [INF] Request finished in 956.6813ms 400 application/json; charset=utf-8 (15c52c40)
2017-04-20T11:37:58.3918390-05:00 [DBG] Connection id ""0HL481DNUOBGU"" received FIN. (acf58720)
2017-04-20T11:37:58.3918390-05:00 [DBG] Connection id ""0HL481DNUOBGT"" received FIN. (acf58720)
2017-04-20T11:37:58.3919610-05:00 [DBG] Connection id ""0HL481DNUOBGT"" disconnecting. (b29b9868)
2017-04-20T11:37:58.3919600-05:00 [DBG] Connection id ""0HL481DNUOBGU"" disconnecting. (b29b9868)
2017-04-20T11:37:58.3920110-05:00 [DBG] Connection id ""0HL481DNUOBGT"" sending FIN. (ffb251f5)
2017-04-20T11:37:58.3920570-05:00 [DBG] Connection id ""0HL481DNUOBGU"" sending FIN. (ffb251f5)
2017-04-20T11:37:58.3921150-05:00 [DBG] Connection id ""0HL481DNUOBGU"" sent FIN with status "0". (69d90ca7)
2017-04-20T11:37:58.3921360-05:00 [DBG] Connection id ""0HL481DNUOBGT"" sent FIN with status "0". (69d90ca7)
2017-04-20T11:37:58.3921880-05:00 [DBG] Connection id ""0HL481DNUOBGU"" stopped. (056149f8)
2017-04-20T11:37:58.3921880-05:00 [DBG] Connection id ""0HL481DNUOBGT"" stopped. (056149f8)
2017-04-20T11:39:08.8648310-05:00 [DBG] Connection id ""0HL481DNUOBH2"" started. (1426b994)
2017-04-20T11:39:08.8648300-05:00 [DBG] Connection id ""0HL481DNUOBH1"" started. (1426b994)
2017-04-20T11:39:08.9771260-05:00 0HL481DO0HIV9 [INF] Request starting HTTP/1.1 GET http://localhost:5000/register (e5be5b71)
2017-04-20T11:39:08.9797620-05:00 0HL481DO0HIV9 [INF] Handling request: /register (d15267fc)
2017-04-20T11:39:08.9798190-05:00 0HL481DO0HIV9 [INF] Rewriting path: /register > / (b5db4a63)
2017-04-20T11:39:08.9799910-05:00 0HL481DO0HIV9 [INF] Sending file. Request path: '"/index.html"'. Physical path: '"/Users/bholt/dev/aspnet-core-react-template/api/wwwroot/index.html"' (27b0a520)
2017-04-20T11:39:08.9802130-05:00 0HL481DO0HIV9 [INF] Finished handling request. (d2c25297)
2017-04-20T11:39:08.9802920-05:00 0HL481DO0HIV9 [DBG] Connection id ""0HL481DNUOBH1"" completed keep alive response. (9784cde9)
2017-04-20T11:39:08.9803620-05:00 0HL481DO0HIV9 [INF] Request finished in 3.2755ms 200 text/html (15c52c40)
2017-04-20T11:39:08.9822110-05:00 [DBG] Connection id ""0HL481DNUOBGS"" received FIN. (acf58720)
2017-04-20T11:39:08.9871980-05:00 0HL481DO0HIVA [INF] Request starting HTTP/1.1 GET http://localhost:5000/main.js (e5be5b71)
2017-04-20T11:39:09.0885690-05:00 0HL481DO0HIVA [DBG] Connection id ""0HL481DNUOBH1"" completed keep alive response. (9784cde9)
2017-04-20T11:39:09.0887120-05:00 0HL481DO0HIVA [INF] Request finished in 101.5631ms 200 application/javascript; charset=UTF-8 (15c52c40)
2017-04-20T11:39:09.2537060-05:00 0HL481DO0HIVB [INF] Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr (e5be5b71)
2017-04-20T11:39:09.8290340-05:00 0HL481DO0HIVC [INF] Request starting HTTP/1.1 GET http://localhost:5000/register (e5be5b71)
2017-04-20T11:39:09.8308800-05:00 0HL481DO0HIVC [INF] Handling request: /register (d15267fc)
2017-04-20T11:39:09.8309960-05:00 0HL481DO0HIVC [INF] Rewriting path: /register > / (b5db4a63)
2017-04-20T11:39:09.8311750-05:00 0HL481DO0HIVC [INF] The file "/index.html" was not modified (f1f8d725)
2017-04-20T11:39:09.8312350-05:00 0HL481DO0HIVC [DBG] Handled. Status code: 304 File: "/index.html" (58f8d392)
2017-04-20T11:39:09.8312670-05:00 0HL481DO0HIVC [INF] Finished handling request. (d2c25297)
2017-04-20T11:39:09.8313890-05:00 0HL481DO0HIVC [DBG] Connection id ""0HL481DNUOBH2"" completed keep alive response. (9784cde9)
2017-04-20T11:39:09.8314930-05:00 0HL481DO0HIVC [INF] Request finished in 2.4718ms 304 text/html (15c52c40)
2017-04-20T11:39:09.8334490-05:00 [DBG] Connection id ""0HL481DNUOBH1"" received FIN. (acf58720)
2017-04-20T11:39:09.8381890-05:00 0HL481DO0HIVD [INF] Request starting HTTP/1.1 GET http://localhost:5000/main.js (e5be5b71)
2017-04-20T11:39:09.8744170-05:00 0HL481DO0HIVD [DBG] Connection id ""0HL481DNUOBH2"" completed keep alive response. (9784cde9)
2017-04-20T11:39:09.8745270-05:00 0HL481DO0HIVD [INF] Request finished in 36.3432ms 200 application/javascript; charset=UTF-8 (15c52c40)
2017-04-20T11:39:10.0234160-05:00 0HL481DO0HIVE [INF] Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr (e5be5b71)
2017-04-20T11:39:10.0562140-05:00 [INF] Connection id ""0HL481DNUOBGS"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe
2017-04-20T11:39:10.0562050-05:00 [DBG] Connection id ""0HL481DNUOBGS"" disconnecting. (b29b9868)
2017-04-20T11:39:10.0563640-05:00 [DBG] Connection id ""0HL481DNUOBGS"" stopped. (056149f8)
2017-04-20T11:39:10.0587750-05:00 [INF] Connection id ""0HL481DNUOBH1"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe
2017-04-20T11:39:10.0587850-05:00 [DBG] Connection id ""0HL481DNUOBH1"" disconnecting. (b29b9868)
2017-04-20T11:39:10.0589970-05:00 [DBG] Connection id ""0HL481DNUOBH1"" stopped. (056149f8)
2017-04-20T11:39:14.1101400-05:00 0HL481DO0HIVF [INF] Request starting HTTP/1.1 POST http://localhost:5000/api/auth/register application/x-www-form-urlencoded 41 (e5be5b71)
2017-04-20T11:39:14.1120980-05:00 0HL481DO0HIVF [INF] Handling request: /api/auth/register (2c1017b8)
2017-04-20T11:39:14.1121790-05:00 0HL481DO0HIVF [DBG] "POST" requests are not supported (1c759b4c)
2017-04-20T11:39:14.1124730-05:00 0HL481DO0HIVF [INF] "Bearer" was not authenticated. Failure message: "Authentication failed because the access token was invalid." (48071232)
2017-04-20T11:39:14.1125950-05:00 0HL481DO0HIVF [INF] "Bearer" was not authenticated. Failure message: "No SecurityTokenValidator available for token: null" (48071232)
2017-04-20T11:39:14.1127600-05:00 0HL481DO0HIVF [DBG] Request successfully matched the route with name 'null' and template '"api/auth/register"'. (555ac2ba)
2017-04-20T11:39:14.1140020-05:00 0HL481DO0HIVF [DBG] Executing action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" (3f3ef15a)
2017-04-20T11:39:14.1156750-05:00 0HL481DO0HIVF [INF] Executing action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" with arguments (["aspnetCoreReactTemplate.ViewModels.NewUser"]) - ModelState is Valid (ba7f4ac2)
2017-04-20T11:39:14.1415600-05:00 0HL481DO0HIVF [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:39:14.1455590-05:00 0HL481DO0HIVF [INF] Executed DbCommand (1ms) [Parameters=[@__normalizedUserName_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedUserName" = @__normalizedUserName_0
LIMIT 1 (6438bdd5)
2017-04-20T11:39:14.1458010-05:00 0HL481DO0HIVF [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:39:14.1460050-05:00 0HL481DO0HIVF [WRN] User "2f93a607-6b5b-4b6b-899b-f459f4322d02" validation failed: "DuplicateUserName". (5dc28e15)
2017-04-20T11:39:14.1461340-05:00 0HL481DO0HIVF [DBG] Executed action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)", returned result "Microsoft.AspNetCore.Mvc.BadRequestObjectResult". (f72615e0)
2017-04-20T11:39:14.1463360-05:00 0HL481DO0HIVF [DBG] No information found on request to perform content negotiation. (6aec0ec5)
2017-04-20T11:39:14.1464230-05:00 0HL481DO0HIVF [DBG] Selected output formatter '"Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter"' and content type '"application/json"' to write the response. (fcc32779)
2017-04-20T11:39:14.1464610-05:00 0HL481DO0HIVF [INF] Executing ObjectResult, writing value "Microsoft.AspNetCore.Mvc.ControllerContext". (4e968210)
2017-04-20T11:39:14.1467060-05:00 0HL481DO0HIVF [INF] Executed action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" in 32.6371ms (afa2e885)
2017-04-20T11:39:14.1468290-05:00 0HL481DO0HIVF [INF] Finished handling request. (d2c25297)
2017-04-20T11:39:14.1470340-05:00 0HL481DO0HIVF [DBG] Connection id ""0HL481DNUOBGV"" completed keep alive response. (9784cde9)
2017-04-20T11:39:14.1471100-05:00 0HL481DO0HIVF [INF] Request finished in 37.0278ms 400 application/json; charset=utf-8 (15c52c40)
2017-04-20T11:39:48.9834480-05:00 [DBG] Connection id ""0HL481DNUOBH0"" disconnecting. (b29b9868)
2017-04-20T11:39:48.9835820-05:00 [DBG] Connection id ""0HL481DNUOBH0"" sending FIN. (ffb251f5)
2017-04-20T11:39:48.9836800-05:00 [DBG] Connection id ""0HL481DNUOBH0"" sent FIN with status "0". (69d90ca7)
2017-04-20T11:39:48.9838000-05:00 [DBG] Connection id ""0HL481DNUOBH0"" stopped. (056149f8)
2017-04-20T11:39:58.9621780-05:00 0HL481DO0HIVG [INF] Request starting HTTP/1.1 POST http://localhost:5000/api/auth/register application/x-www-form-urlencoded 41 (e5be5b71)
2017-04-20T11:39:58.9649200-05:00 0HL481DO0HIVG [INF] Handling request: /api/auth/register (2c1017b8)
2017-04-20T11:39:58.9650300-05:00 0HL481DO0HIVG [DBG] "POST" requests are not supported (1c759b4c)
2017-04-20T11:39:58.9652620-05:00 0HL481DO0HIVG [INF] "Bearer" was not authenticated. Failure message: "Authentication failed because the access token was invalid." (48071232)
2017-04-20T11:39:58.9653330-05:00 0HL481DO0HIVG [INF] "Bearer" was not authenticated. Failure message: "No SecurityTokenValidator available for token: null" (48071232)
2017-04-20T11:39:58.9655650-05:00 0HL481DO0HIVG [DBG] Request successfully matched the route with name 'null' and template '"api/auth/register"'. (555ac2ba)
2017-04-20T11:39:58.9656550-05:00 0HL481DO0HIVG [DBG] Executing action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" (3f3ef15a)
2017-04-20T11:39:58.9659790-05:00 0HL481DO0HIVG [INF] Executing action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" with arguments (["aspnetCoreReactTemplate.ViewModels.NewUser"]) - ModelState is Valid (ba7f4ac2)
2017-04-20T11:39:58.9859840-05:00 0HL481DO0HIVG [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:39:58.9877550-05:00 0HL481DO0HIVG [INF] Executed DbCommand (1ms) [Parameters=[@__normalizedUserName_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedUserName" = @__normalizedUserName_0
LIMIT 1 (6438bdd5)
2017-04-20T11:39:58.9879100-05:00 0HL481DO0HIVG [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:39:58.9880440-05:00 0HL481DO0HIVG [WRN] User "86431f92-3002-4f53-bb99-3becedaaddbe" validation failed: "DuplicateUserName". (5dc28e15)
2017-04-20T11:39:58.9881080-05:00 0HL481DO0HIVG [DBG] Executed action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)", returned result "Microsoft.AspNetCore.Mvc.BadRequestObjectResult". (f72615e0)
2017-04-20T11:39:58.9881740-05:00 0HL481DO0HIVG [DBG] No information found on request to perform content negotiation. (6aec0ec5)
2017-04-20T11:39:58.9882110-05:00 0HL481DO0HIVG [DBG] Selected output formatter '"Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter"' and content type '"application/json"' to write the response. (fcc32779)
2017-04-20T11:39:58.9882440-05:00 0HL481DO0HIVG [INF] Executing ObjectResult, writing value "Microsoft.AspNetCore.Mvc.ControllerContext". (4e968210)
2017-04-20T11:39:58.9883520-05:00 0HL481DO0HIVG [INF] Executed action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" in 22.6438ms (afa2e885)
2017-04-20T11:39:58.9884410-05:00 0HL481DO0HIVG [INF] Finished handling request. (d2c25297)
2017-04-20T11:39:58.9884990-05:00 0HL481DO0HIVG [DBG] Connection id ""0HL481DNUOBGV"" completed keep alive response. (9784cde9)
2017-04-20T11:39:58.9885460-05:00 0HL481DO0HIVG [INF] Request finished in 26.4137ms 400 application/json; charset=utf-8 (15c52c40)
2017-04-20T11:40:02.4118890-05:00 0HL481DO0HIVH [INF] Request starting HTTP/1.1 POST http://localhost:5000/api/auth/register application/x-www-form-urlencoded 41 (e5be5b71)
2017-04-20T11:40:02.4152190-05:00 0HL481DO0HIVH [INF] Handling request: /api/auth/register (2c1017b8)
2017-04-20T11:40:02.4153030-05:00 0HL481DO0HIVH [DBG] "POST" requests are not supported (1c759b4c)
2017-04-20T11:40:02.4155360-05:00 0HL481DO0HIVH [INF] "Bearer" was not authenticated. Failure message: "Authentication failed because the access token was invalid." (48071232)
2017-04-20T11:40:02.4156250-05:00 0HL481DO0HIVH [INF] "Bearer" was not authenticated. Failure message: "No SecurityTokenValidator available for token: null" (48071232)
2017-04-20T11:40:02.4157540-05:00 0HL481DO0HIVH [DBG] Request successfully matched the route with name 'null' and template '"api/auth/register"'. (555ac2ba)
2017-04-20T11:40:02.4158230-05:00 0HL481DO0HIVH [DBG] Executing action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" (3f3ef15a)
2017-04-20T11:40:02.4161110-05:00 0HL481DO0HIVH [INF] Executing action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" with arguments (["aspnetCoreReactTemplate.ViewModels.NewUser"]) - ModelState is Valid (ba7f4ac2)
2017-04-20T11:40:02.4384170-05:00 0HL481DO0HIVH [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:40:02.4402280-05:00 0HL481DO0HIVH [INF] Executed DbCommand (1ms) [Parameters=[@__normalizedUserName_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedUserName" = @__normalizedUserName_0
LIMIT 1 (6438bdd5)
2017-04-20T11:40:02.4405080-05:00 0HL481DO0HIVH [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:40:02.4407150-05:00 0HL481DO0HIVH [WRN] User "8a5d0dff-4e0d-47dc-99c6-dfb6f331b36e" validation failed: "DuplicateUserName". (5dc28e15)
2017-04-20T11:40:02.4407910-05:00 0HL481DO0HIVH [DBG] Executed action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)", returned result "Microsoft.AspNetCore.Mvc.BadRequestObjectResult". (f72615e0)
2017-04-20T11:40:02.4408430-05:00 0HL481DO0HIVH [DBG] No information found on request to perform content negotiation. (6aec0ec5)
2017-04-20T11:40:02.4408950-05:00 0HL481DO0HIVH [DBG] Selected output formatter '"Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter"' and content type '"application/json"' to write the response. (fcc32779)
2017-04-20T11:40:02.4409290-05:00 0HL481DO0HIVH [INF] Executing ObjectResult, writing value "Microsoft.AspNetCore.Mvc.ControllerContext". (4e968210)
2017-04-20T11:40:02.4410590-05:00 0HL481DO0HIVH [INF] Executed action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" in 25.1783ms (afa2e885)
2017-04-20T11:40:02.4411560-05:00 0HL481DO0HIVH [INF] Finished handling request. (d2c25297)
2017-04-20T11:40:02.4412390-05:00 0HL481DO0HIVH [DBG] Connection id ""0HL481DNUOBGV"" completed keep alive response. (9784cde9)
2017-04-20T11:40:02.4413110-05:00 0HL481DO0HIVH [INF] Request finished in 29.4581ms 400 application/json; charset=utf-8 (15c52c40)
2017-04-20T11:40:06.6871600-05:00 [DBG] Connection id ""0HL481DNUOBH3"" started. (1426b994)
2017-04-20T11:40:06.6873480-05:00 0HL481DO0HIVI [INF] Request starting HTTP/1.1 GET http://localhost:5000/register (e5be5b71)
2017-04-20T11:40:06.6896230-05:00 0HL481DO0HIVI [INF] Handling request: /register (d15267fc)
2017-04-20T11:40:06.6896800-05:00 0HL481DO0HIVI [INF] Rewriting path: /register > / (b5db4a63)
2017-04-20T11:40:06.6899040-05:00 0HL481DO0HIVI [INF] The file "/index.html" was not modified (f1f8d725)
2017-04-20T11:40:06.6899730-05:00 0HL481DO0HIVI [DBG] Handled. Status code: 304 File: "/index.html" (58f8d392)
2017-04-20T11:40:06.6900170-05:00 0HL481DO0HIVI [INF] Finished handling request. (d2c25297)
2017-04-20T11:40:06.6900850-05:00 0HL481DO0HIVI [DBG] Connection id ""0HL481DNUOBH3"" completed keep alive response. (9784cde9)
2017-04-20T11:40:06.6901910-05:00 0HL481DO0HIVI [INF] Request finished in 2.828ms 304 text/html (15c52c40)
2017-04-20T11:40:06.6920350-05:00 [DBG] Connection id ""0HL481DNUOBH2"" received FIN. (acf58720)
2017-04-20T11:40:06.6982060-05:00 0HL481DO0HIVJ [INF] Request starting HTTP/1.1 GET http://localhost:5000/main.js (e5be5b71)
2017-04-20T11:40:06.7981140-05:00 0HL481DO0HIVJ [DBG] Connection id ""0HL481DNUOBH3"" completed keep alive response. (9784cde9)
2017-04-20T11:40:06.7982550-05:00 0HL481DO0HIVJ [INF] Request finished in 100.0866ms 200 application/javascript; charset=UTF-8 (15c52c40)
2017-04-20T11:40:06.9514120-05:00 0HL481DO0HIVK [INF] Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr (e5be5b71)
2017-04-20T11:40:07.7135560-05:00 [DBG] Connection id ""0HL481DNUOBH4"" started. (1426b994)
2017-04-20T11:40:07.7137430-05:00 0HL481DO0HIVL [INF] Request starting HTTP/1.1 GET http://localhost:5000/register (e5be5b71)
2017-04-20T11:40:07.7165340-05:00 0HL481DO0HIVL [INF] Handling request: /register (d15267fc)
2017-04-20T11:40:07.7166070-05:00 0HL481DO0HIVL [INF] Rewriting path: /register > / (b5db4a63)
2017-04-20T11:40:07.7168370-05:00 0HL481DO0HIVL [INF] The file "/index.html" was not modified (f1f8d725)
2017-04-20T11:40:07.7169050-05:00 0HL481DO0HIVL [DBG] Handled. Status code: 304 File: "/index.html" (58f8d392)
2017-04-20T11:40:07.7169620-05:00 0HL481DO0HIVL [INF] Finished handling request. (d2c25297)
2017-04-20T11:40:07.7170540-05:00 0HL481DO0HIVL [DBG] Connection id ""0HL481DNUOBH4"" completed keep alive response. (9784cde9)
2017-04-20T11:40:07.7171230-05:00 0HL481DO0HIVL [INF] Request finished in 3.3808ms 304 text/html (15c52c40)
2017-04-20T11:40:07.7190570-05:00 [DBG] Connection id ""0HL481DNUOBH3"" received FIN. (acf58720)
2017-04-20T11:40:07.7245360-05:00 0HL481DO0HIVM [INF] Request starting HTTP/1.1 GET http://localhost:5000/main.js (e5be5b71)
2017-04-20T11:40:07.7679270-05:00 0HL481DO0HIVM [DBG] Connection id ""0HL481DNUOBH4"" completed keep alive response. (9784cde9)
2017-04-20T11:40:07.7680490-05:00 0HL481DO0HIVM [INF] Request finished in 43.5382ms 200 application/javascript; charset=UTF-8 (15c52c40)
2017-04-20T11:40:07.9121720-05:00 0HL481DO0HIVN [INF] Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr (e5be5b71)
2017-04-20T11:40:07.9323120-05:00 [INF] Connection id ""0HL481DNUOBH2"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe
2017-04-20T11:40:07.9323120-05:00 [DBG] Connection id ""0HL481DNUOBH2"" disconnecting. (b29b9868)
2017-04-20T11:40:07.9325000-05:00 [INF] Connection id ""0HL481DNUOBH2"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe
2017-04-20T11:40:07.9327500-05:00 [INF] Connection id ""0HL481DNUOBH3"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe
2017-04-20T11:40:07.9328240-05:00 [DBG] Connection id ""0HL481DNUOBH3"" disconnecting. (b29b9868)
2017-04-20T11:40:07.9329040-05:00 [DBG] Connection id ""0HL481DNUOBH2"" stopped. (056149f8)
2017-04-20T11:40:07.9329500-05:00 [DBG] Connection id ""0HL481DNUOBH3"" stopped. (056149f8)
2017-04-20T11:40:12.8112560-05:00 0HL481DO0HIVO [INF] Request starting HTTP/1.1 POST http://localhost:5000/api/auth/register application/x-www-form-urlencoded 41 (e5be5b71)
2017-04-20T11:40:12.8130870-05:00 0HL481DO0HIVO [INF] Handling request: /api/auth/register (2c1017b8)
2017-04-20T11:40:12.8132280-05:00 0HL481DO0HIVO [DBG] "POST" requests are not supported (1c759b4c)
2017-04-20T11:40:12.8134190-05:00 0HL481DO0HIVO [INF] "Bearer" was not authenticated. Failure message: "Authentication failed because the access token was invalid." (48071232)
2017-04-20T11:40:12.8135180-05:00 0HL481DO0HIVO [INF] "Bearer" was not authenticated. Failure message: "No SecurityTokenValidator available for token: null" (48071232)
2017-04-20T11:40:12.8136160-05:00 0HL481DO0HIVO [DBG] Request successfully matched the route with name 'null' and template '"api/auth/register"'. (555ac2ba)
2017-04-20T11:40:12.8136940-05:00 0HL481DO0HIVO [DBG] Executing action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" (3f3ef15a)
2017-04-20T11:40:12.8139390-05:00 0HL481DO0HIVO [INF] Executing action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" with arguments (["aspnetCoreReactTemplate.ViewModels.NewUser"]) - ModelState is Valid (ba7f4ac2)
2017-04-20T11:40:12.8347490-05:00 0HL481DO0HIVO [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:40:12.8363430-05:00 0HL481DO0HIVO [INF] Executed DbCommand (1ms) [Parameters=[@__normalizedUserName_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedUserName" = @__normalizedUserName_0
LIMIT 1 (6438bdd5)
2017-04-20T11:40:12.8365570-05:00 0HL481DO0HIVO [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:40:12.8367310-05:00 0HL481DO0HIVO [WRN] User "ccb83522-ab79-4c44-9b0b-5ff35929e0a2" validation failed: "DuplicateUserName". (5dc28e15)
2017-04-20T11:40:12.8368240-05:00 0HL481DO0HIVO [DBG] Executed action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)", returned result "Microsoft.AspNetCore.Mvc.BadRequestObjectResult". (f72615e0)
2017-04-20T11:40:12.8368970-05:00 0HL481DO0HIVO [DBG] No information found on request to perform content negotiation. (6aec0ec5)
2017-04-20T11:40:12.8369660-05:00 0HL481DO0HIVO [DBG] Selected output formatter '"Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter"' and content type '"application/json"' to write the response. (fcc32779)
2017-04-20T11:40:12.8370050-05:00 0HL481DO0HIVO [INF] Executing ObjectResult, writing value "Microsoft.AspNetCore.Mvc.ControllerContext". (4e968210)
2017-04-20T11:40:12.8371390-05:00 0HL481DO0HIVO [INF] Executed action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" in 23.4046ms (afa2e885)
2017-04-20T11:40:12.8373040-05:00 0HL481DO0HIVO [INF] Finished handling request. (d2c25297)
2017-04-20T11:40:12.8373970-05:00 0HL481DO0HIVO [DBG] Connection id ""0HL481DNUOBGV"" completed keep alive response. (9784cde9)
2017-04-20T11:40:12.8374680-05:00 0HL481DO0HIVO [INF] Request finished in 26.2417ms 400 application/json; charset=utf-8 (15c52c40)
2017-04-20T11:40:18.4429330-05:00 0HL481DO0HIVP [INF] Request starting HTTP/1.1 POST http://localhost:5000/api/auth/register application/x-www-form-urlencoded 43 (e5be5b71)
2017-04-20T11:40:18.4456770-05:00 0HL481DO0HIVP [INF] Handling request: /api/auth/register (2c1017b8)
2017-04-20T11:40:18.4458000-05:00 0HL481DO0HIVP [DBG] "POST" requests are not supported (1c759b4c)
2017-04-20T11:40:18.4460320-05:00 0HL481DO0HIVP [INF] "Bearer" was not authenticated. Failure message: "Authentication failed because the access token was invalid." (48071232)
2017-04-20T11:40:18.4461620-05:00 0HL481DO0HIVP [INF] "Bearer" was not authenticated. Failure message: "No SecurityTokenValidator available for token: null" (48071232)
2017-04-20T11:40:18.4463040-05:00 0HL481DO0HIVP [DBG] Request successfully matched the route with name 'null' and template '"api/auth/register"'. (555ac2ba)
2017-04-20T11:40:18.4463950-05:00 0HL481DO0HIVP [DBG] Executing action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" (3f3ef15a)
2017-04-20T11:40:18.4468380-05:00 0HL481DO0HIVP [INF] Executing action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" with arguments (["aspnetCoreReactTemplate.ViewModels.NewUser"]) - ModelState is Valid (ba7f4ac2)
2017-04-20T11:40:18.4673860-05:00 0HL481DO0HIVP [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:40:18.4687650-05:00 0HL481DO0HIVP [INF] Executed DbCommand (1ms) [Parameters=[@__normalizedUserName_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedUserName" = @__normalizedUserName_0
LIMIT 1 (6438bdd5)
2017-04-20T11:40:18.4688690-05:00 0HL481DO0HIVP [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:40:18.5011340-05:00 0HL481DO0HIVP [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:40:18.5012750-05:00 0HL481DO0HIVP [DBG] Beginning transaction with isolation level 'Unspecified'. (3b5ca34b)
2017-04-20T11:40:18.5092810-05:00 0HL481DO0HIVP [INF] Executed DbCommand (2ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?', @p8='?', @p9='?', @p10='?', @p11='?', @p12='?', @p13='?', @p14='?', @p15='?'], CommandType='Text', CommandTimeout='30']
INSERT INTO "AspNetUsers" ("Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "GivenName", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UserName")
VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15); (6438bdd5)
2017-04-20T11:40:18.5199150-05:00 0HL481DO0HIVP [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:40:18.5220720-05:00 0HL481DO0HIVP [INF] New user registered (id: 28e718f7-6d7a-4eb5-9d7d-3983acd1cfeb) (ee102ef0)
2017-04-20T11:40:18.5488350-05:00 0HL481DO0HIVP [DBG] Reading data from file '"/Users/bholt/.aspnet/DataProtection-Keys/key-2115e1cc-6a7a-4f94-a5af-79045dd7268a.xml"'. (5ce001c4)
2017-04-20T11:40:18.5536860-05:00 0HL481DO0HIVP [DBG] Reading data from file '"/Users/bholt/.aspnet/DataProtection-Keys/key-65a1dbdc-ff60-43d0-ad97-4b44b66d8604.xml"'. (5ce001c4)
2017-04-20T11:40:18.5614190-05:00 0HL481DO0HIVP [DBG] Found key {2115e1cc-6a7a-4f94-a5af-79045dd7268a}. (f843275d)
2017-04-20T11:40:18.5668030-05:00 0HL481DO0HIVP [DBG] Found key {65a1dbdc-ff60-43d0-ad97-4b44b66d8604}. (f843275d)
2017-04-20T11:40:18.5819820-05:00 0HL481DO0HIVP [DBG] Considering key {2115e1cc-6a7a-4f94-a5af-79045dd7268a} with expiration date 2017-07-15 20:23:44Z as default key. (ca2e3b22)
2017-04-20T11:40:18.5986940-05:00 0HL481DO0HIVP [DBG] Using managed symmetric algorithm '"System.Security.Cryptography.Aes"'. (0f299fe5)
2017-04-20T11:40:18.5998270-05:00 0HL481DO0HIVP [DBG] Using managed keyed hash algorithm '"System.Security.Cryptography.HMACSHA256"'. (47d8f6fe)
2017-04-20T11:40:18.6142350-05:00 0HL481DO0HIVP [DBG] Using key {2115e1cc-6a7a-4f94-a5af-79045dd7268a} as the default key. (4cf2d764)
2017-04-20T11:40:19.1260690-05:00 0HL481DO0HIVP [INF] Sent email confirmation email (id: 28e718f7-6d7a-4eb5-9d7d-3983acd1cfeb) (88a75a42)
2017-04-20T11:40:19.2434760-05:00 0HL481DO0HIVP [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:40:19.2513050-05:00 0HL481DO0HIVP [INF] Executed DbCommand (6ms) [Parameters=[@__userId_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "role"."Name"
FROM "AspNetUserRoles" AS "userRole"
INNER JOIN "AspNetRoles" AS "role" ON "userRole"."RoleId" = "role"."Id"
WHERE "userRole"."UserId" = @__userId_0 (6438bdd5)
2017-04-20T11:40:19.2522840-05:00 0HL481DO0HIVP [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:40:19.2770190-05:00 0HL481DO0HIVP [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:40:19.2791770-05:00 0HL481DO0HIVP [INF] Executed DbCommand (1ms) [Parameters=[@__user_Id_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "uc"."Id", "uc"."ClaimType", "uc"."ClaimValue", "uc"."UserId"
FROM "AspNetUserClaims" AS "uc"
WHERE "uc"."UserId" = @__user_Id_0 (6438bdd5)
2017-04-20T11:40:19.2794120-05:00 0HL481DO0HIVP [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:40:19.2890810-05:00 0HL481DO0HIVP [INF] User logged in (id: 28e718f7-6d7a-4eb5-9d7d-3983acd1cfeb) (bf48a8ee)
2017-04-20T11:40:19.2893740-05:00 0HL481DO0HIVP [DBG] Executed action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)", returned result "Microsoft.AspNetCore.Mvc.OkResult". (f72615e0)
2017-04-20T11:40:19.2922430-05:00 0HL481DO0HIVP [INF] Executing HttpStatusCodeResult, setting HTTP status code 200 (e28ccfae)
2017-04-20T11:40:19.2931220-05:00 0HL481DO0HIVP [INF] Executed action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" in 846.7138ms (afa2e885)
2017-04-20T11:40:19.2932340-05:00 0HL481DO0HIVP [INF] Finished handling request. (d2c25297)
2017-04-20T11:40:19.2939380-05:00 0HL481DO0HIVP [DBG] Connection id ""0HL481DNUOBGV"" completed keep alive response. (9784cde9)
2017-04-20T11:40:19.2940030-05:00 0HL481DO0HIVP [INF] Request finished in 851.1767ms 200 (15c52c40)
2017-04-20T11:40:19.8710400-05:00 [DBG] Connection id ""0HL481DNUOBH5"" started. (1426b994)
2017-04-20T11:40:19.8712390-05:00 0HL481DO0HIVQ [INF] Request starting HTTP/1.1 GET http://localhost:5000/favicon.ico (e5be5b71)
2017-04-20T11:40:19.8732470-05:00 0HL481DO0HIVQ [INF] Handling request: /favicon.ico (b3d76b52)
2017-04-20T11:40:19.8735140-05:00 0HL481DO0HIVQ [INF] Sending file. Request path: '"/favicon.ico"'. Physical path: '"/Users/bholt/dev/aspnet-core-react-template/api/wwwroot/favicon.ico"' (27b0a520)
2017-04-20T11:40:19.8744590-05:00 0HL481DO0HIVQ [INF] Finished handling request. (d2c25297)
2017-04-20T11:40:19.8745650-05:00 0HL481DO0HIVQ [DBG] Connection id ""0HL481DNUOBH5"" completed keep alive response. (9784cde9)
2017-04-20T11:40:19.8747030-05:00 0HL481DO0HIVQ [INF] Request finished in 3.427ms 200 image/x-icon (15c52c40)
2017-04-20T11:42:20.0860490-05:00 [DBG] Connection id ""0HL481DNUOBGV"" disconnecting. (b29b9868)
2017-04-20T11:42:20.0862240-05:00 [DBG] Connection id ""0HL481DNUOBGV"" sending FIN. (ffb251f5)
2017-04-20T11:42:20.0863450-05:00 [DBG] Connection id ""0HL481DNUOBGV"" sent FIN with status "0". (69d90ca7)
2017-04-20T11:42:20.0864070-05:00 [DBG] Connection id ""0HL481DNUOBGV"" stopped. (056149f8)
2017-04-20T11:42:21.0952590-05:00 [DBG] Connection id ""0HL481DNUOBH5"" disconnecting. (b29b9868)
2017-04-20T11:42:21.0954820-05:00 [DBG] Connection id ""0HL481DNUOBH5"" sending FIN. (ffb251f5)
2017-04-20T11:42:21.0956160-05:00 [DBG] Connection id ""0HL481DNUOBH5"" sent FIN with status "0". (69d90ca7)
2017-04-20T11:42:21.0957040-05:00 [DBG] Connection id ""0HL481DNUOBH5"" stopped. (056149f8)
2017-04-20T11:45:42.4452760-05:00 [DBG] Connection id ""0HL481DNUOBH6"" started. (1426b994)
2017-04-20T11:45:42.4454930-05:00 0HL481DO0HIVR [INF] Request starting HTTP/1.1 GET http://localhost:5000/register (e5be5b71)
2017-04-20T11:45:42.4470350-05:00 0HL481DO0HIVR [INF] Handling request: /register (d15267fc)
2017-04-20T11:45:42.4470960-05:00 0HL481DO0HIVR [INF] Rewriting path: /register > / (b5db4a63)
2017-04-20T11:45:42.4472760-05:00 0HL481DO0HIVR [INF] The file "/index.html" was not modified (f1f8d725)
2017-04-20T11:45:42.4473350-05:00 0HL481DO0HIVR [DBG] Handled. Status code: 304 File: "/index.html" (58f8d392)
2017-04-20T11:45:42.4473680-05:00 0HL481DO0HIVR [INF] Finished handling request. (d2c25297)
2017-04-20T11:45:42.4474200-05:00 0HL481DO0HIVR [DBG] Connection id ""0HL481DNUOBH6"" completed keep alive response. (9784cde9)
2017-04-20T11:45:42.4474760-05:00 0HL481DO0HIVR [INF] Request finished in 2.0026ms 304 text/html (15c52c40)
2017-04-20T11:45:42.4492840-05:00 [DBG] Connection id ""0HL481DNUOBH4"" received FIN. (acf58720)
2017-04-20T11:45:42.4549310-05:00 0HL481DO0HIVS [INF] Request starting HTTP/1.1 GET http://localhost:5000/main.js (e5be5b71)
2017-04-20T11:45:42.5539130-05:00 0HL481DO0HIVS [DBG] Connection id ""0HL481DNUOBH6"" completed keep alive response. (9784cde9)
2017-04-20T11:45:42.5540400-05:00 0HL481DO0HIVS [INF] Request finished in 99.113ms 200 application/javascript; charset=UTF-8 (15c52c40)
2017-04-20T11:45:42.7079810-05:00 0HL481DO0HIVT [INF] Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr (e5be5b71)
2017-04-20T11:45:42.7262130-05:00 [DBG] Connection id ""0HL481DNUOBH4"" disconnecting. (b29b9868)
2017-04-20T11:45:42.7262060-05:00 [INF] Connection id ""0HL481DNUOBH4"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe
2017-04-20T11:45:42.7265250-05:00 [DBG] Connection id ""0HL481DNUOBH4"" stopped. (056149f8)
2017-04-20T11:45:44.0215750-05:00 [DBG] Connection id ""0HL481DNUOBH7"" started. (1426b994)
2017-04-20T11:45:44.0217810-05:00 0HL481DO0HIVU [INF] Request starting HTTP/1.1 GET http://localhost:5000/register (e5be5b71)
2017-04-20T11:45:44.0246960-05:00 0HL481DO0HIVU [INF] Handling request: /register (d15267fc)
2017-04-20T11:45:44.0247650-05:00 0HL481DO0HIVU [INF] Rewriting path: /register > / (b5db4a63)
2017-04-20T11:45:44.0250240-05:00 0HL481DO0HIVU [INF] The file "/index.html" was not modified (f1f8d725)
2017-04-20T11:45:44.0250900-05:00 0HL481DO0HIVU [DBG] Handled. Status code: 304 File: "/index.html" (58f8d392)
2017-04-20T11:45:44.0251170-05:00 0HL481DO0HIVU [INF] Finished handling request. (d2c25297)
2017-04-20T11:45:44.0252020-05:00 0HL481DO0HIVU [DBG] Connection id ""0HL481DNUOBH7"" completed keep alive response. (9784cde9)
2017-04-20T11:45:44.0252840-05:00 0HL481DO0HIVU [INF] Request finished in 3.5368ms 304 text/html (15c52c40)
2017-04-20T11:45:44.0272240-05:00 [DBG] Connection id ""0HL481DNUOBH6"" received FIN. (acf58720)
2017-04-20T11:45:44.0331880-05:00 0HL481DO0HIVV [INF] Request starting HTTP/1.1 GET http://localhost:5000/main.js (e5be5b71)
2017-04-20T11:45:44.0766880-05:00 0HL481DO0HIVV [DBG] Connection id ""0HL481DNUOBH7"" completed keep alive response. (9784cde9)
2017-04-20T11:45:44.0768270-05:00 0HL481DO0HIVV [INF] Request finished in 43.6235ms 200 application/javascript; charset=UTF-8 (15c52c40)
2017-04-20T11:45:44.2229510-05:00 0HL481DO0HJ00 [INF] Request starting HTTP/1.1 GET http://localhost:5000/__webpack_hmr (e5be5b71)
2017-04-20T11:45:44.2441810-05:00 [INF] Connection id ""0HL481DNUOBH6"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe
2017-04-20T11:45:44.2441810-05:00 [DBG] Connection id ""0HL481DNUOBH6"" disconnecting. (b29b9868)
2017-04-20T11:45:44.2445160-05:00 [DBG] Connection id ""0HL481DNUOBH6"" stopped. (056149f8)
2017-04-20T11:45:47.6464490-05:00 [DBG] Connection id ""0HL481DNUOBH8"" started. (1426b994)
2017-04-20T11:45:47.6466580-05:00 0HL481DO0HJ01 [INF] Request starting HTTP/1.1 POST http://localhost:5000/api/auth/register application/x-www-form-urlencoded 41 (e5be5b71)
2017-04-20T11:45:47.6479610-05:00 0HL481DO0HJ01 [INF] Handling request: /api/auth/register (2c1017b8)
2017-04-20T11:45:47.6480340-05:00 0HL481DO0HJ01 [DBG] "POST" requests are not supported (1c759b4c)
2017-04-20T11:45:47.6499000-05:00 0HL481DO0HJ01 [INF] "Bearer" was not authenticated. Failure message: "Authentication failed because the access token was invalid." (48071232)
2017-04-20T11:45:47.6499920-05:00 0HL481DO0HJ01 [INF] "Bearer" was not authenticated. Failure message: "No SecurityTokenValidator available for token: undefined" (48071232)
2017-04-20T11:45:47.6501160-05:00 0HL481DO0HJ01 [DBG] Request successfully matched the route with name 'null' and template '"api/auth/register"'. (555ac2ba)
2017-04-20T11:45:47.6501750-05:00 0HL481DO0HJ01 [DBG] Executing action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" (3f3ef15a)
2017-04-20T11:45:47.6504120-05:00 0HL481DO0HJ01 [INF] Executing action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" with arguments (["aspnetCoreReactTemplate.ViewModels.NewUser"]) - ModelState is Valid (ba7f4ac2)
2017-04-20T11:45:47.6704730-05:00 0HL481DO0HJ01 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:45:47.6722490-05:00 0HL481DO0HJ01 [INF] Executed DbCommand (1ms) [Parameters=[@__normalizedUserName_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedUserName" = @__normalizedUserName_0
LIMIT 1 (6438bdd5)
2017-04-20T11:45:47.6724530-05:00 0HL481DO0HJ01 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:45:47.6726710-05:00 0HL481DO0HJ01 [WRN] User "56e5f22f-fe8e-48e6-948b-df981b56a516" validation failed: "DuplicateUserName". (5dc28e15)
2017-04-20T11:45:47.6727610-05:00 0HL481DO0HJ01 [DBG] Executed action method "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)", returned result "Microsoft.AspNetCore.Mvc.BadRequestObjectResult". (f72615e0)
2017-04-20T11:45:47.6728260-05:00 0HL481DO0HJ01 [DBG] No information found on request to perform content negotiation. (6aec0ec5)
2017-04-20T11:45:47.6728740-05:00 0HL481DO0HJ01 [DBG] Selected output formatter '"Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter"' and content type '"application/json"' to write the response. (fcc32779)
2017-04-20T11:45:47.6729030-05:00 0HL481DO0HJ01 [INF] Executing ObjectResult, writing value "Microsoft.AspNetCore.Mvc.ControllerContext". (4e968210)
2017-04-20T11:45:47.6730350-05:00 0HL481DO0HJ01 [INF] Executed action "aspnetCoreReactTemplate.aspnetCoreReactTemplate.Controllers.AuthController.Register (api)" in 22.8055ms (afa2e885)
2017-04-20T11:45:47.6731460-05:00 0HL481DO0HJ01 [INF] Finished handling request. (d2c25297)
2017-04-20T11:45:47.6732390-05:00 0HL481DO0HJ01 [DBG] Connection id ""0HL481DNUOBH8"" completed keep alive response. (9784cde9)
2017-04-20T11:45:47.6733630-05:00 0HL481DO0HJ01 [INF] Request finished in 26.7243ms 400 application/json; charset=utf-8 (15c52c40)
2017-04-20T11:46:32.0935980-05:00 [DBG] Connection id ""0HL481DNUOBH7"" received FIN. (acf58720)
2017-04-20T11:46:44.7399420-05:00 [INF] Connection id ""0HL481DNUOBH7"" communication error. (7fa6c29c)
Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -32 EPIPE broken pipe
2017-04-20T11:46:44.7399420-05:00 [DBG] Connection id ""0HL481DNUOBH7"" disconnecting. (b29b9868)
2017-04-20T11:46:44.7401040-05:00 [DBG] Connection id ""0HL481DNUOBH7"" stopped. (056149f8)
2017-04-20T11:47:49.3103430-05:00 [DBG] Connection id ""0HL481DNUOBH8"" disconnecting. (b29b9868)
2017-04-20T11:47:49.3104560-05:00 [DBG] Connection id ""0HL481DNUOBH8"" sending FIN. (ffb251f5)
2017-04-20T11:47:49.3105770-05:00 [DBG] Connection id ""0HL481DNUOBH8"" sent FIN with status "0". (69d90ca7)
2017-04-20T11:47:49.3106450-05:00 [DBG] Connection id ""0HL481DNUOBH8"" stopped. (056149f8)
2017-04-20T11:52:20.1843890-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:20.2332790-05:00 [INF] Executed DbCommand (12ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:52:20.2351180-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:20.2481480-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:20.2500520-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:52:20.2501960-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:20.2571800-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:20.2592600-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId"; (6438bdd5)
2017-04-20T11:52:20.2599360-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:20.6921930-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:20.9067920-05:00 [INF] Executed DbCommand (80ms) [Parameters=[@__normalizedEmail_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedEmail" = @__normalizedEmail_0
LIMIT 1 (6438bdd5)
2017-04-20T11:52:20.9730240-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:21.0340690-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:21.0403040-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM "Contacts" AS "c")
THEN TRUE::bool ELSE FALSE::bool
END (6438bdd5)
2017-04-20T11:52:21.0413620-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:21.0642120-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:21.0653390-05:00 [INF] Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "c"."contactId", "c"."email", "c"."name", "c"."phone"
FROM "Contacts" AS "c" (6438bdd5)
2017-04-20T11:52:21.0931910-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:21.1567550-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:21.1638260-05:00 [DBG] Beginning transaction with isolation level 'Unspecified'. (3b5ca34b)
2017-04-20T11:52:21.2243800-05:00 [INF] Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30']
DELETE FROM "Contacts"
WHERE "contactId" = @p0;
DELETE FROM "Contacts"
WHERE "contactId" = @p1;
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p2, @p3, @p4)
RETURNING "contactId";
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p5, @p6, @p7)
RETURNING "contactId"; (6438bdd5)
2017-04-20T11:52:21.2502520-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:22.7258160-05:00 [INF] ts-loader: Using typescript@2.2.2 and /Users/bholt/dev/aspnet-core-react-template/client-react/tsconfig.json (114b565e)
2017-04-20T11:52:22.8394760-05:00 [DBG] Hosting starting (32b26330)
2017-04-20T11:52:22.9107110-05:00 [DBG] Hosting started (e6def423)
2017-04-20T11:52:27.5521150-05:00 [INF] webpack built d5ef16186ce4d979a8ac in 5111ms (1f3d84b9)
2017-04-20T11:52:47.2953080-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:47.3580130-05:00 [INF] Executed DbCommand (19ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:52:47.3602790-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:47.3782690-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:47.3805780-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:52:47.3806700-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:47.3875940-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:47.3896410-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId"; (6438bdd5)
2017-04-20T11:52:47.3902200-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:47.8297450-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:48.0395240-05:00 [INF] Executed DbCommand (75ms) [Parameters=[@__normalizedEmail_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedEmail" = @__normalizedEmail_0
LIMIT 1 (6438bdd5)
2017-04-20T11:52:48.1077930-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:48.1673110-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:48.1728720-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM "Contacts" AS "c")
THEN TRUE::bool ELSE FALSE::bool
END (6438bdd5)
2017-04-20T11:52:48.1738080-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:48.1944370-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:48.1957490-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "c"."contactId", "c"."email", "c"."name", "c"."phone"
FROM "Contacts" AS "c" (6438bdd5)
2017-04-20T11:52:48.2256620-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:48.2887970-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:48.2950040-05:00 [DBG] Beginning transaction with isolation level 'Unspecified'. (3b5ca34b)
2017-04-20T11:52:48.3600290-05:00 [INF] Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30']
DELETE FROM "Contacts"
WHERE "contactId" = @p0;
DELETE FROM "Contacts"
WHERE "contactId" = @p1;
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p2, @p3, @p4)
RETURNING "contactId";
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p5, @p6, @p7)
RETURNING "contactId"; (6438bdd5)
2017-04-20T11:52:48.3845130-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:52:49.8241640-05:00 [INF] ts-loader: Using typescript@2.2.2 and /Users/bholt/dev/aspnet-core-react-template/client-react/tsconfig.json (114b565e)
2017-04-20T11:52:49.9339700-05:00 [DBG] Hosting starting (32b26330)
2017-04-20T11:52:50.0188480-05:00 [DBG] Hosting started (e6def423)
2017-04-20T11:52:55.0134310-05:00 [INF] webpack built d5ef16186ce4d979a8ac in 5531ms (b9c85d60)
2017-04-20T11:54:37.8666580-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:37.9142260-05:00 [INF] Executed DbCommand (13ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:54:37.9161890-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:37.9289630-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:37.9304160-05:00 [INF] Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:54:37.9304990-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:37.9374140-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:37.9396900-05:00 [INF] Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId"; (6438bdd5)
2017-04-20T11:54:37.9402820-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:38.3839950-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:38.6121920-05:00 [INF] Executed DbCommand (77ms) [Parameters=[@__normalizedEmail_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedEmail" = @__normalizedEmail_0
LIMIT 1 (6438bdd5)
2017-04-20T11:54:38.6732720-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:38.7260900-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:38.7327780-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM "Contacts" AS "c")
THEN TRUE::bool ELSE FALSE::bool
END (6438bdd5)
2017-04-20T11:54:38.7341370-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:38.7549120-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:38.7562400-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "c"."contactId", "c"."email", "c"."name", "c"."phone"
FROM "Contacts" AS "c" (6438bdd5)
2017-04-20T11:54:38.7832790-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:38.8424430-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:38.8480970-05:00 [DBG] Beginning transaction with isolation level 'Unspecified'. (3b5ca34b)
2017-04-20T11:54:38.9072120-05:00 [INF] Executed DbCommand (5ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30']
DELETE FROM "Contacts"
WHERE "contactId" = @p0;
DELETE FROM "Contacts"
WHERE "contactId" = @p1;
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p2, @p3, @p4)
RETURNING "contactId";
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p5, @p6, @p7)
RETURNING "contactId"; (6438bdd5)
2017-04-20T11:54:38.9331130-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:40.1053810-05:00 [INF] ts-loader: Using typescript@2.2.2 and /Users/bholt/dev/aspnet-core-react-template/client-react/tsconfig.json (114b565e)
2017-04-20T11:54:40.2924400-05:00 [DBG] Hosting starting (32b26330)
2017-04-20T11:54:40.3627690-05:00 [DBG] Hosting started (e6def423)
2017-04-20T11:54:50.6248200-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:50.6718600-05:00 [INF] Executed DbCommand (12ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:54:50.6737260-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:50.6870270-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:50.6895530-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:54:50.6896620-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:50.6964780-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:50.6985020-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId"; (6438bdd5)
2017-04-20T11:54:50.6991060-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:51.1002400-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:51.3094630-05:00 [INF] Executed DbCommand (72ms) [Parameters=[@__normalizedEmail_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedEmail" = @__normalizedEmail_0
LIMIT 1 (6438bdd5)
2017-04-20T11:54:51.3715670-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:51.4247370-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:51.4297140-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM "Contacts" AS "c")
THEN TRUE::bool ELSE FALSE::bool
END (6438bdd5)
2017-04-20T11:54:51.4310560-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:51.4494260-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:51.4508040-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "c"."contactId", "c"."email", "c"."name", "c"."phone"
FROM "Contacts" AS "c" (6438bdd5)
2017-04-20T11:54:51.4763700-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:51.5366480-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:51.5426550-05:00 [DBG] Beginning transaction with isolation level 'Unspecified'. (3b5ca34b)
2017-04-20T11:54:51.6043500-05:00 [INF] Executed DbCommand (5ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30']
DELETE FROM "Contacts"
WHERE "contactId" = @p0;
DELETE FROM "Contacts"
WHERE "contactId" = @p1;
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p2, @p3, @p4)
RETURNING "contactId";
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p5, @p6, @p7)
RETURNING "contactId"; (6438bdd5)
2017-04-20T11:54:51.6280460-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:54:52.8274950-05:00 [INF] ts-loader: Using typescript@2.2.2 and /Users/bholt/dev/aspnet-core-react-template/client-react/tsconfig.json (114b565e)
2017-04-20T11:54:52.8352330-05:00 [DBG] Hosting starting (32b26330)
2017-04-20T11:54:52.9060220-05:00 [DBG] Hosting started (e6def423)
2017-04-20T11:54:57.5428390-05:00 [INF] webpack built d5ef16186ce4d979a8ac in 4979ms (b9b435f5)
2017-04-20T11:55:53.0172200-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.0730740-05:00 [INF] Executed DbCommand (13ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:55:53.0748940-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.0888600-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.0904870-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T11:55:53.0906000-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.0971490-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.0988070-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId"; (6438bdd5)
2017-04-20T11:55:53.0993710-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.5183410-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.7221070-05:00 [INF] Executed DbCommand (70ms) [Parameters=[@__normalizedEmail_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedEmail" = @__normalizedEmail_0
LIMIT 1 (6438bdd5)
2017-04-20T11:55:53.7940560-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.8483900-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.8535630-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM "Contacts" AS "c")
THEN TRUE::bool ELSE FALSE::bool
END (6438bdd5)
2017-04-20T11:55:53.8547220-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.8735420-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.8749900-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "c"."contactId", "c"."email", "c"."name", "c"."phone"
FROM "Contacts" AS "c" (6438bdd5)
2017-04-20T11:55:53.9024970-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.9601450-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:53.9665450-05:00 [DBG] Beginning transaction with isolation level 'Unspecified'. (3b5ca34b)
2017-04-20T11:55:54.0287680-05:00 [INF] Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30']
DELETE FROM "Contacts"
WHERE "contactId" = @p0;
DELETE FROM "Contacts"
WHERE "contactId" = @p1;
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p2, @p3, @p4)
RETURNING "contactId";
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p5, @p6, @p7)
RETURNING "contactId"; (6438bdd5)
2017-04-20T11:55:54.0585200-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T11:55:55.2623320-05:00 [DBG] Hosting starting (32b26330)
2017-04-20T11:55:55.2623220-05:00 [INF] ts-loader: Using typescript@2.2.2 and /Users/bholt/dev/aspnet-core-react-template/client-react/tsconfig.json (114b565e)
2017-04-20T11:55:55.3342570-05:00 [DBG] Hosting started (e6def423)
2017-04-20T11:56:00.1801500-05:00 [INF] webpack built d5ef16186ce4d979a8ac in 5200ms (956f4986)
2017-04-20T12:00:22.4181940-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:22.4677210-05:00 [INF] Executed DbCommand (13ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T12:00:22.4696350-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:22.4831110-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:22.4846130-05:00 [INF] Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T12:00:22.4847230-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:22.4915870-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:22.4937610-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId"; (6438bdd5)
2017-04-20T12:00:22.4944190-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:22.9182370-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:23.1413910-05:00 [INF] Executed DbCommand (84ms) [Parameters=[@__normalizedEmail_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedEmail" = @__normalizedEmail_0
LIMIT 1 (6438bdd5)
2017-04-20T12:00:23.2110220-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:23.2746920-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:23.2808440-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM "Contacts" AS "c")
THEN TRUE::bool ELSE FALSE::bool
END (6438bdd5)
2017-04-20T12:00:23.2819780-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:23.3029210-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:23.3043030-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "c"."contactId", "c"."email", "c"."name", "c"."phone"
FROM "Contacts" AS "c" (6438bdd5)
2017-04-20T12:00:23.3355490-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:23.4000400-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:23.4061710-05:00 [DBG] Beginning transaction with isolation level 'Unspecified'. (3b5ca34b)
2017-04-20T12:00:23.4717800-05:00 [INF] Executed DbCommand (4ms) [Parameters=[@p0='?', @p1='?', @p2='?', @p3='?', @p4='?', @p5='?', @p6='?', @p7='?'], CommandType='Text', CommandTimeout='30']
DELETE FROM "Contacts"
WHERE "contactId" = @p0;
DELETE FROM "Contacts"
WHERE "contactId" = @p1;
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p2, @p3, @p4)
RETURNING "contactId";
INSERT INTO "Contacts" ("email", "name", "phone")
VALUES (@p5, @p6, @p7)
RETURNING "contactId"; (6438bdd5)
2017-04-20T12:00:23.4978960-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:00:25.0319380-05:00 [INF] ts-loader: Using typescript@2.2.2 and /Users/bholt/dev/aspnet-core-react-template/client-react/tsconfig.json (114b565e)
2017-04-20T12:00:25.1801430-05:00 [DBG] Hosting starting (32b26330)
2017-04-20T12:00:25.2532920-05:00 [DBG] Hosting started (e6def423)
2017-04-20T12:00:29.8988860-05:00 [INF] webpack built d5ef16186ce4d979a8ac in 5161ms (08a05fce)
2017-04-20T12:00:41.9349910-05:00 [INF] Received SIGINT. Waiting for .NET process to exit... (39e2bf0e)
2017-04-20T12:00:41.9382870-05:00 [DBG] Hosting shutdown (49005419)
2017-04-20T12:03:38.5101220-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:03:38.5572210-05:00 [INF] Executed DbCommand (12ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T12:03:38.5590790-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:03:38.5721740-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:03:38.5734910-05:00 [INF] Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory'); (6438bdd5)
2017-04-20T12:03:38.5735800-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:03:38.5807060-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:03:38.5824650-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "MigrationId", "ProductVersion"
FROM "__EFMigrationsHistory"
ORDER BY "MigrationId"; (6438bdd5)
2017-04-20T12:03:38.5831840-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:03:38.9784220-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:03:39.1762800-05:00 [INF] Executed DbCommand (72ms) [Parameters=[@__normalizedEmail_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "u"."Id", "u"."AccessFailedCount", "u"."ConcurrencyStamp", "u"."Email", "u"."EmailConfirmed", "u"."GivenName", "u"."LockoutEnabled", "u"."LockoutEnd", "u"."NormalizedEmail", "u"."NormalizedUserName", "u"."PasswordHash", "u"."PhoneNumber", "u"."PhoneNumberConfirmed", "u"."SecurityStamp", "u"."TwoFactorEnabled", "u"."UserName"
FROM "AspNetUsers" AS "u"
WHERE "u"."NormalizedEmail" = @__normalizedEmail_0
LIMIT 1 (6438bdd5)
2017-04-20T12:03:39.2326690-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:03:39.2856610-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:03:39.2914480-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM "Contacts" AS "c")
THEN TRUE::bool ELSE FALSE::bool
END (6438bdd5)
2017-04-20T12:03:39.2925420-05:00 [DBG] Closing connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:03:39.3124240-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. (3b5ca34b)
2017-04-20T12:03:39.3137460-05:00 [INF] Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT "c"."contactId", "c"."email", "c"."name", "c"."phone"
FROM "Contacts" AS "c" (6438bdd5)
2017-04-20T12:03:39.3442980-
gitextract_5pf0t787/
├── .editorconfig
├── .github/
│ └── FUNDING.yml
├── .gitignore
├── .vscode/
│ ├── launch.json
│ ├── settings.json
│ └── tasks.json
├── LICENSE
├── README.md
├── api/
│ ├── .config/
│ │ └── dotnet-tools.json
│ ├── Controllers/
│ │ ├── AuthController.cs
│ │ └── ContactController.cs
│ ├── Extensions/
│ │ └── StringExtension.cs
│ ├── Middleware/
│ │ ├── SpaFallbackMiddleware.cs
│ │ └── SpaFallbackOptions.cs
│ ├── Migrations/
│ │ ├── 20171204210645_Initial.Designer.cs
│ │ ├── 20171204210645_Initial.cs
│ │ ├── 20200128145031_1580223026.Designer.cs
│ │ ├── 20200128145031_1580223026.cs
│ │ └── DefaultDbContextModelSnapshot.cs
│ ├── Models/
│ │ ├── ApplicationUser.cs
│ │ ├── Contact.cs
│ │ ├── DefaultDbContext.cs
│ │ ├── DefaultDbContextInitializer.cs
│ │ └── DesignTimeDefaultDbContext.cs
│ ├── NuGet.Config
│ ├── Program.cs
│ ├── Properties/
│ │ └── launchSettings.json
│ ├── Services/
│ │ ├── EmailSender.cs
│ │ ├── EmailSenderOptions.cs
│ │ ├── IEmailSender.cs
│ │ └── JwtOptions.cs
│ ├── Startup.cs
│ ├── ViewModels/
│ │ ├── ConfirmEmail.cs
│ │ └── NewUser.cs
│ ├── api.csproj
│ ├── appsettings.json
│ └── log/
│ └── development-20170420.log
├── api.sln
├── api.test/
│ ├── Controller/
│ │ └── Tests.cs
│ ├── ControllerTests.cs
│ ├── NuGet.Config
│ ├── Unit/
│ │ └── Tests.cs
│ └── api.test.csproj
├── client-react/
│ ├── boot.tsx
│ ├── components/
│ │ ├── Auth.tsx
│ │ ├── ContactForm.tsx
│ │ ├── Contacts.tsx
│ │ ├── Error.tsx
│ │ ├── Header.tsx
│ │ └── Routes.tsx
│ ├── index.ejs
│ ├── polyfills/
│ │ ├── array-find.d.ts
│ │ ├── array-find.ts
│ │ ├── object-assign.d.ts
│ │ └── object-assign.ts
│ ├── services/
│ │ ├── Auth.ts
│ │ ├── Contacts.ts
│ │ └── RestUtilities.ts
│ ├── stores/
│ │ └── Auth.ts
│ ├── styles/
│ │ ├── auth.styl
│ │ ├── contacts.styl
│ │ ├── global.css
│ │ └── styles.d.ts
│ ├── tsconfig.json
│ ├── webpack.config.js
│ └── webpack.config.release.js
├── client-react.test/
│ ├── polyfill/
│ │ └── localStorage.js
│ ├── tests/
│ │ └── Contacts.tsx
│ ├── tests.tsx
│ ├── tsconfig.json
│ └── utils.ts
├── docker-compose.yml
├── global.json
├── ops/
│ ├── README.md
│ ├── config.yml.example
│ ├── deploy.yml
│ ├── group_vars/
│ │ └── all
│ ├── library/
│ │ └── ghetto_json
│ ├── provision.yml
│ └── roles/
│ ├── deploy/
│ │ ├── defaults/
│ │ │ └── main.yml
│ │ ├── meta/
│ │ │ └── main.yml
│ │ └── tasks/
│ │ └── main.yml
│ ├── deploy_user/
│ │ ├── meta/
│ │ │ └── main.yml
│ │ └── tasks/
│ │ └── main.yml
│ ├── dotnetcore/
│ │ ├── defaults/
│ │ │ └── main.yml
│ │ └── tasks/
│ │ └── main.yml
│ ├── firewall/
│ │ ├── handlers/
│ │ │ └── main.yml
│ │ └── tasks/
│ │ └── main.yml
│ ├── nginx/
│ │ ├── defaults/
│ │ │ └── main.yml
│ │ ├── handlers/
│ │ │ └── main.yml
│ │ ├── tasks/
│ │ │ └── main.yml
│ │ └── templates/
│ │ └── etc_nginx_sites-available.conf.j2
│ ├── postgresql/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── defaults/
│ │ │ └── main.yml
│ │ ├── handlers/
│ │ │ └── main.yml
│ │ ├── tasks/
│ │ │ ├── backup.yml
│ │ │ ├── configure.yml
│ │ │ ├── install.yml
│ │ │ └── main.yml
│ │ ├── templates/
│ │ │ └── pgsql_backup.sh.j2
│ │ └── vars/
│ │ └── main.yml
│ ├── s3cmd/
│ │ ├── meta/
│ │ │ └── main.yml
│ │ ├── tasks/
│ │ │ └── main.yml
│ │ └── templates/
│ │ └── s3cfg.j2
│ ├── ssl/
│ │ ├── defaults/
│ │ │ └── main.yml
│ │ ├── meta/
│ │ │ └── main.yml
│ │ ├── tasks/
│ │ │ └── main.yml
│ │ └── templates/
│ │ └── config.j2
│ └── supervisor/
│ ├── defaults/
│ │ └── main.yml
│ ├── handlers/
│ │ └── main.yml
│ ├── tasks/
│ │ └── main.yml
│ └── templates/
│ └── etc_supervisor_conf.d_app_name.conf.j2
├── package.json
└── scripts/
└── create-migration.js
SYMBOL INDEX (135 symbols across 39 files)
FILE: api.test/Controller/Tests.cs
class Tests (line 7) | public class Tests
FILE: api.test/ControllerTests.cs
class ControllerTests (line 5) | public class ControllerTests
method Test1 (line 7) | [Fact]
FILE: api.test/Unit/Tests.cs
class Tests (line 6) | public class Tests
method TestNewContactProperties (line 8) | [Fact]
FILE: api/Controllers/AuthController.cs
class AuthController (line 19) | public class AuthController : Controller
method AuthController (line 28) | public AuthController(
method Login (line 44) | [AllowAnonymous]
method Register (line 92) | [AllowAnonymous]
method Confirm (line 132) | [AllowAnonymous]
FILE: api/Controllers/ContactController.cs
class ContactsController (line 11) | [Authorize]
method ContactsController (line 17) | public ContactsController(DefaultDbContext context)
method Get (line 23) | [HttpGet]
method Get (line 30) | [HttpGet("{id}", Name = "GetContact")]
method Search (line 37) | [HttpGet("search")]
method Post (line 46) | [HttpPost]
method Put (line 60) | [HttpPut("{id}")]
method Delete (line 75) | [HttpDelete("{id}")]
FILE: api/Extensions/StringExtension.cs
class StringExtensions (line 5) | public static class StringExtensions
method ToSnakeCase (line 7) | public static string ToSnakeCase(this string input)
FILE: api/Middleware/SpaFallbackMiddleware.cs
class SpaFallbackMiddleware (line 31) | public class SpaFallbackMiddleware
method SpaFallbackMiddleware (line 37) | public SpaFallbackMiddleware(RequestDelegate next, ILoggerFactory logg...
method Invoke (line 44) | public async Task Invoke(HttpContext context)
class SpaFallbackExtensions (line 60) | public static class SpaFallbackExtensions
method UseSpaFallback (line 62) | public static IApplicationBuilder UseSpaFallback(this IApplicationBuil...
FILE: api/Middleware/SpaFallbackOptions.cs
class SpaFallbackOptions (line 3) | public class SpaFallbackOptions
method SpaFallbackOptions (line 5) | public SpaFallbackOptions()
FILE: api/Migrations/20171204210645_Initial.Designer.cs
class Initial (line 14) | [DbContext(typeof(DefaultDbContext))]
method BuildTargetModel (line 18) | protected override void BuildTargetModel(ModelBuilder modelBuilder)
FILE: api/Migrations/20171204210645_Initial.cs
class Initial (line 9) | public partial class Initial : Migration
method Up (line 11) | protected override void Up(MigrationBuilder migrationBuilder)
method Down (line 213) | protected override void Down(MigrationBuilder migrationBuilder)
FILE: api/Migrations/20200128145031_1580223026.Designer.cs
class _1580223026 (line 12) | [DbContext(typeof(DefaultDbContext))]
method BuildTargetModel (line 16) | protected override void BuildTargetModel(ModelBuilder modelBuilder)
FILE: api/Migrations/20200128145031_1580223026.cs
class _1580223026 (line 5) | public partial class _1580223026 : Migration
method Up (line 7) | protected override void Up(MigrationBuilder migrationBuilder)
method Down (line 12) | protected override void Down(MigrationBuilder migrationBuilder)
FILE: api/Migrations/DefaultDbContextModelSnapshot.cs
class DefaultDbContextModelSnapshot (line 11) | [DbContext(typeof(DefaultDbContext))]
method BuildModel (line 14) | protected override void BuildModel(ModelBuilder modelBuilder)
FILE: api/Models/ApplicationUser.cs
class ApplicationUser (line 6) | public class ApplicationUser: IdentityUser
FILE: api/Models/Contact.cs
class Contact (line 5) | public class Contact
FILE: api/Models/DefaultDbContext.cs
class DefaultDbContext (line 7) | public class DefaultDbContext : IdentityDbContext<ApplicationUser>
method DefaultDbContext (line 9) | public DefaultDbContext(DbContextOptions<DefaultDbContext> options)
method OnModelCreating (line 17) | protected override void OnModelCreating(ModelBuilder modelBuilder)
FILE: api/Models/DefaultDbContextInitializer.cs
class DefaultDbContextInitializer (line 7) | public class DefaultDbContextInitializer : IDefaultDbContextInitializer
method DefaultDbContextInitializer (line 13) | public DefaultDbContextInitializer(DefaultDbContext context, UserManag...
method EnsureCreated (line 20) | public bool EnsureCreated()
method Seed (line 25) | public async Task Seed()
type IDefaultDbContextInitializer (line 55) | public interface IDefaultDbContextInitializer
method EnsureCreated (line 57) | bool EnsureCreated();
method Seed (line 58) | Task Seed();
FILE: api/Models/DesignTimeDefaultDbContext.cs
class BloggingContextFactory (line 7) | public class BloggingContextFactory : IDesignTimeDbContextFactory<Defaul...
method CreateDbContext (line 9) | public DefaultDbContext CreateDbContext(string[] args)
FILE: api/Program.cs
class Program (line 12) | public class Program
method Main (line 14) | public static void Main(string[] args)
method CreateHostBuilder (line 39) | public static IHostBuilder CreateHostBuilder(IConfigurationRoot config...
FILE: api/Services/EmailSender.cs
class EmailSender (line 9) | public class EmailSender : IEmailSender
method EmailSender (line 11) | public EmailSender(IOptions<EmailSenderOptions> optionsAccessor)
method SendEmailAsync (line 18) | public async Task SendEmailAsync(string toEmail, string subject, strin...
FILE: api/Services/EmailSenderOptions.cs
class EmailSenderOptions (line 6) | public class EmailSenderOptions
FILE: api/Services/IEmailSender.cs
type IEmailSender (line 5) | public interface IEmailSender
method SendEmailAsync (line 7) | Task SendEmailAsync(string toEmail, string subject, string htmlMessage...
FILE: api/Services/JwtOptions.cs
class JwtOptions (line 6) | public class JwtOptions
FILE: api/Startup.cs
class Startup (line 17) | public class Startup
method Startup (line 22) | public Startup(IConfiguration configuration)
method ConfigureServices (line 28) | public void ConfigureServices(IServiceCollection services)
method Configure (line 72) | public void Configure(IApplicationBuilder app, IHostEnvironment env, I...
FILE: api/ViewModels/ConfirmEmail.cs
class ConfirmEmail (line 3) | public class ConfirmEmail
FILE: api/ViewModels/NewUser.cs
class NewUser (line 5) | public class NewUser
FILE: client-react.test/utils.ts
function stubFetch (line 9) | function stubFetch(returnData: Object) {
FILE: client-react/components/Auth.tsx
class SignIn (line 8) | class SignIn extends React.Component<RouteComponentProps<any>, any> {
method handleSubmit (line 19) | handleSubmit(event: React.FormEvent<HTMLFormElement>) {
method render (line 32) | render() {
class Register (line 78) | class Register extends React.Component<any, any> {
method handleSubmit (line 89) | handleSubmit(event: React.FormEvent<HTMLFormElement>) {
method _formGroupClass (line 102) | _formGroupClass(field: string) {
method render (line 110) | render() {
type RegisterCompleteProps (line 139) | interface RegisterCompleteProps {
class RegisterComplete (line 143) | class RegisterComplete extends React.Component<RegisterCompleteProps, an...
method render (line 144) | render() {
FILE: client-react/components/ContactForm.tsx
class ContactForm (line 9) | class ContactForm extends React.Component<RouteComponentProps<any>, any> {
method componentDidMount (line 15) | componentDidMount() {
method handleSubmit (line 28) | handleSubmit(event: React.FormEvent<HTMLFormElement>) {
method handleInputChange (line 33) | handleInputChange(event: React.ChangeEvent<HTMLInputElement>) {
method saveContact (line 46) | saveContact(contact: IContact) {
method _formGroupClass (line 57) | _formGroupClass(field: string) {
method render (line 65) | render() {
FILE: client-react/components/Contacts.tsx
class Contacts (line 10) | class Contacts extends React.Component<RouteComponentProps<any>, any> {
method componentDidMount (line 22) | componentDidMount() {
method showAll (line 26) | showAll() {
method handleSearchQueryChange (line 32) | handleSearchQueryChange(event: React.ChangeEvent<HTMLInputElement>) {
method handleSeachSubmit (line 36) | handleSeachSubmit(event: React.FormEvent<HTMLFormElement>) {
method delete (line 49) | delete(contact: IContact) {
method render (line 57) | render() {
FILE: client-react/components/Error.tsx
class ErrorPage (line 4) | class ErrorPage extends React.Component<RouteComponentProps<any>, any> {
method getErrorCode (line 6) | getErrorCode() {
method getErrorMessage (line 10) | getErrorMessage() {
method render (line 23) | render() {
FILE: client-react/components/Header.tsx
class Header (line 10) | class Header extends React.Component<RouteComponentProps<any>, any> {
method signOut (line 11) | signOut() {
method render (line 16) | render() {
FILE: client-react/components/Routes.tsx
class RoutePaths (line 11) | class RoutePaths {
class Routes (line 19) | class Routes extends React.Component<any, any> {
method render (line 20) | render() {
FILE: client-react/polyfills/array-find.d.ts
type Array (line 1) | interface Array<T> {
FILE: client-react/polyfills/object-assign.d.ts
type ObjectConstructor (line 1) | interface ObjectConstructor {
FILE: client-react/services/Auth.ts
type IAuthResponse (line 4) | interface IAuthResponse {
class Auth (line 8) | class Auth {
method isSignedIn (line 9) | static isSignedIn(): boolean {
method signInOrRegister (line 13) | signInOrRegister(email: string, password: string, isRegister: boolean ...
method signIn (line 24) | signIn(email: string, password: string) {
method register (line 28) | register(email: string, password: string) {
method confirm (line 32) | confirm(token: string): Promise<boolean> {
method signOut (line 42) | signOut(): void {
FILE: client-react/services/Contacts.ts
type IContact (line 3) | interface IContact {
class Contacts (line 11) | class Contacts {
method fetchAll (line 12) | fetchAll() {
method fetch (line 16) | fetch(contactId: number) {
method search (line 20) | search(query: string) {
method update (line 24) | update(contact: IContact) {
method create (line 28) | create(contact: IContact) {
method save (line 32) | save(contact: IContact) {
method delete (line 40) | delete(contactId: number) {
FILE: client-react/services/RestUtilities.ts
type IErrorContent (line 3) | interface IErrorContent {
type IRestResponse (line 9) | interface IRestResponse<T> {
class RestUtilities (line 15) | class RestUtilities {
method get (line 16) | static get<T>(url: string): Promise<IRestResponse<T>> {
method delete (line 20) | static delete(url: string): Promise<IRestResponse<void>> {
method put (line 24) | static put<T>(
method post (line 31) | static post<T>(
method request (line 38) | private static request<T>(
FILE: client-react/stores/Auth.ts
class Auth (line 1) | class Auth {
method getToken (line 4) | static getToken() {
method setToken (line 8) | static setToken(token: string) {
method removeToken (line 12) | static removeToken(): void {
Condensed preview — 115 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (310K chars).
[
{
"path": ".editorconfig",
"chars": 180,
"preview": "root = true\n\n[*]\nend_of_line = lf\ncharset = utf-8\nindent_style = space\ntrim_trailing_whitespace = true\ninsert_final_newl"
},
{
"path": ".github/FUNDING.yml",
"chars": 21,
"preview": "github: [bradymholt]\n"
},
{
"path": ".gitignore",
"chars": 375,
"preview": ".DS_Store\n\n# dotnet core\nbin/\nobj/\nproject.lock.json\nNuGetScratch/\n\napi/wwwroot/**\n!api/wwwroot/scratch.html\n!api/wwwroo"
},
{
"path": ".vscode/launch.json",
"chars": 1280,
"preview": "{\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"name\": \"Debug api/ (server)\",\n \"type\": \"coreclr\",\n "
},
{
"path": ".vscode/settings.json",
"chars": 176,
"preview": "{\n \"files.exclude\": {\n \"**/.git\": true,\n \"**/.svn\": true,\n \"**/.hg\": true,\n \"**/CVS\": true,\n \"**/.DS_Sto"
},
{
"path": ".vscode/tasks.json",
"chars": 612,
"preview": "{\n // See https://go.microsoft.com/fwlink/?LinkId=733558\n // for the documentation about the tasks.json format\n \"vers"
},
{
"path": "LICENSE",
"chars": 1067,
"preview": "MIT License\n\nCopyright (c) 2017 Brady Holt\n\nPermission is hereby granted, free of charge, to any person obtaining a copy"
},
{
"path": "README.md",
"chars": 7575,
"preview": "# ASP.NET Core / React SPA Template App\n\n<img align=\"left\" src=\"https://user-images.githubusercontent.com/759811/2102737"
},
{
"path": "api/.config/dotnet-tools.json",
"chars": 153,
"preview": "{\n \"version\": 1,\n \"isRoot\": true,\n \"tools\": {\n \"dotnet-ef\": {\n \"version\": \"3.1.1\",\n \"commands\": [\n "
},
{
"path": "api/Controllers/AuthController.cs",
"chars": 5685,
"preview": "using System;\nusing System.Text;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Authorizati"
},
{
"path": "api/Controllers/ContactController.cs",
"chars": 2391,
"preview": "using System.Linq;\nusing System.Collections.Generic;\nusing Microsoft.AspNetCore.Authorization;\nusing Microsoft.AspNetCor"
},
{
"path": "api/Extensions/StringExtension.cs",
"chars": 476,
"preview": "using System.Text.RegularExpressions;\n\nnamespace aspnetCoreReactTemplate.Extensions\n{\n public static class StringExt"
},
{
"path": "api/Middleware/SpaFallbackMiddleware.cs",
"chars": 2971,
"preview": "using System.Threading.Tasks;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.Exten"
},
{
"path": "api/Middleware/SpaFallbackOptions.cs",
"chars": 317,
"preview": "namespace aspnetCoreReactTemplate\n{\n public class SpaFallbackOptions\n {\n public SpaFallbackOptions()\n "
},
{
"path": "api/Migrations/20171204210645_Initial.Designer.cs",
"chars": 11762,
"preview": "// <auto-generated />\nusing aspnetCoreReactTemplate.Models;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.Entity"
},
{
"path": "api/Migrations/20171204210645_Initial.cs",
"chars": 10753,
"preview": "using Microsoft.EntityFrameworkCore.Metadata;\nusing Microsoft.EntityFrameworkCore.Migrations;\nusing Npgsql.EntityFramew"
},
{
"path": "api/Migrations/20200128145031_1580223026.Designer.cs",
"chars": 14531,
"preview": "// <auto-generated />\nusing System;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Infrastruc"
},
{
"path": "api/Migrations/20200128145031_1580223026.cs",
"chars": 325,
"preview": "using Microsoft.EntityFrameworkCore.Migrations;\n\nnamespace api.Migrations\n{\n public partial class _1580223026 : Migr"
},
{
"path": "api/Migrations/DefaultDbContextModelSnapshot.cs",
"chars": 14466,
"preview": "// <auto-generated />\nusing System;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Infrastruc"
},
{
"path": "api/Models/ApplicationUser.cs",
"chars": 245,
"preview": "using Microsoft.AspNetCore.Identity;\nusing Microsoft.AspNetCore.Identity.EntityFrameworkCore;\n\nnamespace aspnetCoreReact"
},
{
"path": "api/Models/Contact.cs",
"chars": 492,
"preview": "using System.ComponentModel.DataAnnotations;\n\nnamespace aspnetCoreReactTemplate.Models\n{\n public class Contact\n {\n"
},
{
"path": "api/Models/DefaultDbContext.cs",
"chars": 1725,
"preview": "using aspnetCoreReactTemplate.Extensions;\nusing Microsoft.AspNetCore.Identity.EntityFrameworkCore;\nusing Microsoft.Entit"
},
{
"path": "api/Models/DefaultDbContextInitializer.cs",
"chars": 1951,
"preview": "using Microsoft.AspNetCore.Identity;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace aspnetCoreReactTemplate"
},
{
"path": "api/Models/DesignTimeDefaultDbContext.cs",
"chars": 772,
"preview": "using Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Design;\nusing Microsoft.Extensions.Configuratio"
},
{
"path": "api/NuGet.Config",
"chars": 276,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n <packageSources>\n <add key=\"NuGet\" value=\"https://api.nuget."
},
{
"path": "api/Program.cs",
"chars": 1787,
"preview": "using System.IO;\nusing aspnetCoreReactTemplate.Models;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.EntityFramew"
},
{
"path": "api/Properties/launchSettings.json",
"chars": 733,
"preview": "{\n \"iisSettings\": {\n \"windowsAuthentication\": false,\n \"anonymousAuthentication\": true,\n \"iisExpress\": {\n "
},
{
"path": "api/Services/EmailSender.cs",
"chars": 1685,
"preview": "using System.Net;\nusing System.Net.Mail;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Microsoft.Extensions.Opt"
},
{
"path": "api/Services/EmailSenderOptions.cs",
"chars": 1143,
"preview": "using System;\nusing System.Text.RegularExpressions;\n\nnamespace aspnetCoreReactTemplate.Services\n{\n public class EmailSe"
},
{
"path": "api/Services/IEmailSender.cs",
"chars": 232,
"preview": "using System.Threading.Tasks;\n\nnamespace aspnetCoreReactTemplate.Services\n{\n public interface IEmailSender\n {\n "
},
{
"path": "api/Services/JwtOptions.cs",
"chars": 223,
"preview": "using System;\nusing System.Text.RegularExpressions;\n\nnamespace aspnetCoreReactTemplate.Services\n{\n public class JwtOp"
},
{
"path": "api/Startup.cs",
"chars": 3896,
"preview": "using Microsoft.AspNetCore.Builder;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjec"
},
{
"path": "api/ViewModels/ConfirmEmail.cs",
"chars": 177,
"preview": "namespace aspnetCoreReactTemplate.ViewModels\n{\n public class ConfirmEmail\n {\n public string user_id { get; "
},
{
"path": "api/ViewModels/NewUser.cs",
"chars": 303,
"preview": "using System.ComponentModel.DataAnnotations;\n\nnamespace aspnetCoreReactTemplate.ViewModels\n{\n public class NewUser\n "
},
{
"path": "api/api.csproj",
"chars": 1152,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk.Web\">\n <PropertyGroup>\n <TargetFramework>net5.0</TargetFramework>\n </PropertyGroup"
},
{
"path": "api/appsettings.json",
"chars": 735,
"preview": "{\n \"connectionStrings\": {\n \"defaultConnection\": \"Host=localhost;Port=5433;Username=postgres;Password=postgres;Databa"
},
{
"path": "api/log/development-20170420.log",
"chars": 126125,
"preview": "2017-04-20T11:35:30.8306170-05:00 [DBG] Opening connection to database 'dotnetcore' on server 'tcp://localhost:5433'. ("
},
{
"path": "api.sln",
"chars": 1234,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"api\","
},
{
"path": "api.test/Controller/Tests.cs",
"chars": 491,
"preview": "using System.Collections.Generic;\nusing System.Linq;\nusing app = aspnetCoreReactTemplate;\n\nnamespace Tests.Controller\n{"
},
{
"path": "api.test/ControllerTests.cs",
"chars": 277,
"preview": "using Xunit;\n\nnamespace Tests\n{\n public class ControllerTests\n {\n [Fact]\n public void Test1()\n "
},
{
"path": "api.test/NuGet.Config",
"chars": 276,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n <packageSources>\n <add key=\"NuGet\" value=\"https://api.nuget."
},
{
"path": "api.test/Unit/Tests.cs",
"chars": 502,
"preview": "using Xunit;\nusing app = aspnetCoreReactTemplate;\n\nnamespace Tests.Unit\n{\n public class Tests\n {\n [Fact]\n "
},
{
"path": "api.test/api.test.csproj",
"chars": 628,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n <PropertyGroup>\n <TargetFramework>net5.0</TargetFramework>\n </PropertyGroup>\n "
},
{
"path": "client-react/boot.tsx",
"chars": 583,
"preview": "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { BrowserRouter as Router } from 'react-ro"
},
{
"path": "client-react/components/Auth.tsx",
"chars": 6389,
"preview": "import * as React from \"react\";\nimport { Link, Redirect, RouteComponentProps } from 'react-router-dom';\nimport { RoutePa"
},
{
"path": "client-react/components/ContactForm.tsx",
"chars": 4698,
"preview": "import 'object-assign';\nimport * as React from 'react';\nimport { Link, Redirect, RouteComponentProps } from 'react-route"
},
{
"path": "client-react/components/Contacts.tsx",
"chars": 3775,
"preview": "import * as React from \"react\";\nimport { Link, Redirect } from 'react-router-dom';\nimport { RoutePaths } from './Routes'"
},
{
"path": "client-react/components/Error.tsx",
"chars": 858,
"preview": "import * as React from \"react\";\nimport { Link, RouteComponentProps } from 'react-router-dom';\n\nexport class ErrorPage ex"
},
{
"path": "client-react/components/Header.tsx",
"chars": 2580,
"preview": "import * as React from \"react\";\nimport { Link, Redirect } from 'react-router-dom';\nimport { RouteComponentProps } from \""
},
{
"path": "client-react/components/Routes.tsx",
"chars": 1825,
"preview": "import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { Route, Redirect, Switch } from 'react-ro"
},
{
"path": "client-react/index.ejs",
"chars": 613,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\" />\n <meta"
},
{
"path": "client-react/polyfills/array-find.d.ts",
"chars": 71,
"preview": "interface Array<T> {\n find(predicate: (search: T) => boolean): T;\n}\n"
},
{
"path": "client-react/polyfills/array-find.ts",
"chars": 1557,
"preview": "/// <reference path=\"./array-find.d.ts\" />\n\n// https://tc39.github.io/ecma262/#sec-array.prototype.find\nif (!Array.proto"
},
{
"path": "client-react/polyfills/object-assign.d.ts",
"chars": 82,
"preview": "declare interface ObjectConstructor {\n assign(...objects: Object[]): Object;\n}\n"
},
{
"path": "client-react/polyfills/object-assign.ts",
"chars": 923,
"preview": "/// <reference path=\"./object-assign.d.ts\" />\n\nif (typeof Object.assign != 'function') {\n Object.assign = function (t"
},
{
"path": "client-react/services/Auth.ts",
"chars": 1335,
"preview": "import RestUtilities from './RestUtilities';\nimport AuthStore from '../stores/Auth';\n\ninterface IAuthResponse {\n toke"
},
{
"path": "client-react/services/Contacts.ts",
"chars": 1048,
"preview": "import RestUtilities from './RestUtilities';\n\nexport interface IContact {\n id?: number,\n lastName: string;\n fir"
},
{
"path": "client-react/services/RestUtilities.ts",
"chars": 2834,
"preview": "import AuthStore from \"../stores/Auth\";\n\nexport interface IErrorContent {\n error: string;\n error_description: stri"
},
{
"path": "client-react/stores/Auth.ts",
"chars": 369,
"preview": "export default class Auth {\n static STORAGE_KEY: string = \"token\";\n\n static getToken() {\n return window.loc"
},
{
"path": "client-react/styles/auth.styl",
"chars": 716,
"preview": ".auth {\n margin: 0 auto;\n width:500px;\n margin-top:50px;\n padding: 25px;\n background-color: #f2f2f2;\n}\n\n.authEtc {\n"
},
{
"path": "client-react/styles/contacts.styl",
"chars": 38,
"preview": ".content {\n padding: 3rem 1.5rem;\n}\n"
},
{
"path": "client-react/styles/global.css",
"chars": 186,
"preview": "body {\n padding-top: 5rem;\n font-family: \"century gothic\", verdana;\n\n}\n\n.btn-link {\n cursor: pointer;\n}\n\n.btn {\n mar"
},
{
"path": "client-react/styles/styles.d.ts",
"chars": 152,
"preview": "declare module \"*.styl\" {\n let styles: any;\n export default styles;\n}\n\ndeclare module \"*.css\" {\n let styles: an"
},
{
"path": "client-react/tsconfig.json",
"chars": 199,
"preview": "{\n \"compilerOptions\": {\n \"sourceMap\": true,\n \"noImplicitAny\": true,\n \"module\": \"es2015\",\n \"target\": \"es2015"
},
{
"path": "client-react/webpack.config.js",
"chars": 2129,
"preview": "var webpack = require(\"webpack\");\nvar HtmlWebpackPlugin = require(\"html-webpack-plugin\");\nvar releaseConfig = require(\"."
},
{
"path": "client-react/webpack.config.release.js",
"chars": 1216,
"preview": "var webpack = require('webpack');\nvar HtmlWebpackPlugin = require('html-webpack-plugin');\nvar ExtractTextPlugin = requir"
},
{
"path": "client-react.test/polyfill/localStorage.js",
"chars": 304,
"preview": "module.exports = {\n polyfill: function () {\n window.localStorage = window.sessionStorage = {\n getIt"
},
{
"path": "client-react.test/tests/Contacts.tsx",
"chars": 1396,
"preview": "import { expect } from \"chai\";\nimport { mount, shallow, configure } from \"enzyme\";\nimport * as Adapter from \"enzyme-adap"
},
{
"path": "client-react.test/tests.tsx",
"chars": 442,
"preview": "import { JSDOM } from \"jsdom\";\nimport * as localStorage from \"./polyfill/localStorage.js\";\n\nbefore(function() {\n cons"
},
{
"path": "client-react.test/tsconfig.json",
"chars": 271,
"preview": "{\n \"compilerOptions\": {\n \"sourceMap\": true,\n \"noImplicitAny\": true,\n \"module\": \"commonjs\",\n \"target\":\"es201"
},
{
"path": "client-react.test/utils.ts",
"chars": 804,
"preview": "import * as sinon from 'sinon';\n\n\n/**\n * Stubs browser Fetch API and returns given returnData object\n *\n * @param return"
},
{
"path": "docker-compose.yml",
"chars": 327,
"preview": "version: '2'\nservices:\n postgres:\n image: postgres:9.5\n environment:\n - POSTGRES_USER=postgres\n - POSTG"
},
{
"path": "global.json",
"chars": 43,
"preview": "{\n \"sdk\": {\n \"version\": \"5.0.400\"\n }\n}\n"
},
{
"path": "ops/README.md",
"chars": 1350,
"preview": "This folder contains [Ansible](https://www.ansible.com/) assets responsible for provisioning hosts and deploying this ap"
},
{
"path": "ops/config.yml.example",
"chars": 1476,
"preview": "all:\n vars:\n # The following vars apply globally; additional config is in group_vars/all.\n app_name: aspnetCoreRe"
},
{
"path": "ops/deploy.yml",
"chars": 185,
"preview": "---\n- name: deploy\n hosts: all\n gather_facts: false\n remote_user: \"{{ deploy_user }}\"\n roles:\n - deploy\n post_ta"
},
{
"path": "ops/group_vars/all",
"chars": 498,
"preview": "---\ndatabase_name: \"{{ app_name }}\"\ndatabase_username: \"{{ app_name }}\"\nsource_directory: ../api/bin/Release/netcoreapp3"
},
{
"path": "ops/library/ghetto_json",
"chars": 1705,
"preview": "#!/usr/bin/env python\n\n# Source: https://github.com/FauxFaux/ansible-ghetto-json\n\nimport json\nimport sys\nimport shlex\n\nt"
},
{
"path": "ops/provision.yml",
"chars": 775,
"preview": "---\n- name: provision\n hosts: all\n remote_user: root\n # Do not gather facts here because if host does not have python"
},
{
"path": "ops/roles/deploy/defaults/main.yml",
"chars": 38,
"preview": "---\nappsetting_file: appsettings.json\n"
},
{
"path": "ops/roles/deploy/meta/main.yml",
"chars": 37,
"preview": "---\ndependencies:\n- role: supervisor\n"
},
{
"path": "ops/roles/deploy/tasks/main.yml",
"chars": 894,
"preview": "- name: Copy app files\n synchronize: src={{ source_directory }} dest={{ deploy_directory }} delete=yes rsync_opts=--exc"
},
{
"path": "ops/roles/deploy_user/meta/main.yml",
"chars": 37,
"preview": "---\ndependencies:\n- role: postgresql\n"
},
{
"path": "ops/roles/deploy_user/tasks/main.yml",
"chars": 781,
"preview": "- name: Add deploy user\n user: name={{ deploy_user }} shell=/bin/bash append=true\n\n- name: Adding postgres user ({{ pos"
},
{
"path": "ops/roles/dotnetcore/defaults/main.yml",
"chars": 44,
"preview": "---\ndotnetcore_package_name: dotnet-sdk-5.0\n"
},
{
"path": "ops/roles/dotnetcore/tasks/main.yml",
"chars": 592,
"preview": "---\n- name: Download product repository file\n get_url:\n url: \"https://packages.microsoft.com/config/ubuntu/{{ansible"
},
{
"path": "ops/roles/firewall/handlers/main.yml",
"chars": 60,
"preview": "---\n- name: Restart ufw\n service: name=ufw state=restarted\n"
},
{
"path": "ops/roles/firewall/tasks/main.yml",
"chars": 571,
"preview": "---\n- name: Install Uncomplicated Firewall (ufw)\n apt: pkg=ufw state=present cache_valid_time=86400\n\n- name: Configure "
},
{
"path": "ops/roles/nginx/defaults/main.yml",
"chars": 194,
"preview": "---\nnginx_conf_dir: /etc/nginx\nnginx_conf_file: \"{{ nginx_conf_dir }}/sites-available/{{ app_name }}.conf\"\nnginx_conf_en"
},
{
"path": "ops/roles/nginx/handlers/main.yml",
"chars": 74,
"preview": "---\n- name: Reload nginx\n service: name=nginx state=reloaded enabled=true"
},
{
"path": "ops/roles/nginx/tasks/main.yml",
"chars": 491,
"preview": "---\n- name: Install Nginx\n apt: pkg=nginx state=present update_cache=yes\n\n- name: Disable the default site\n file: path"
},
{
"path": "ops/roles/nginx/templates/etc_nginx_sites-available.conf.j2",
"chars": 1048,
"preview": "server {\n listen 80; #default_listen_marker\n server_name {{ webserver_name }};\n\n #ssl_config_marker\n\n gzip_proxied a"
},
{
"path": "ops/roles/postgresql/LICENSE",
"chars": 1066,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n"
},
{
"path": "ops/roles/postgresql/README.md",
"chars": 1497,
"preview": "# ansible-postgresql\n\n[PostgreSQL](http://www.postgresql.org/) is a powerful, open source object-relational database sys"
},
{
"path": "ops/roles/postgresql/defaults/main.yml",
"chars": 559,
"preview": "---\npostgresql_client: no\npostgresql_server: no\n\npostgresql_user: postgres\n\npostgresql_runtime_root: \"{{ runtime_root | "
},
{
"path": "ops/roles/postgresql/handlers/main.yml",
"chars": 115,
"preview": "---\n- name: Reload Service | postgres\n service:\n state: reloaded\n name: postgresql\n tags:\n - disruptive\n"
},
{
"path": "ops/roles/postgresql/tasks/backup.yml",
"chars": 774,
"preview": "---\n- name: \"Directory Exists | {{ postgresql_backup_path }}\"\n file:\n state: directory\n path: \"{{ postgresql_back"
},
{
"path": "ops/roles/postgresql/tasks/configure.yml",
"chars": 1388,
"preview": "---\n- name: \"Directory Exists | {{ postgresql_runtime_root }}\"\n file:\n state: directory\n path: \"{{ postgresql_run"
},
{
"path": "ops/roles/postgresql/tasks/install.yml",
"chars": 1641,
"preview": "---\n- name: Install Packages | apt\n apt:\n state: latest\n pkg: 'postgresql-client'\n when: postgresql_client\n tag"
},
{
"path": "ops/roles/postgresql/tasks/main.yml",
"chars": 137,
"preview": "---\n- include: install.yml\n- { include: backup.yml, when: postgresql_server }\n- { include: configure.yml, when: pos"
},
{
"path": "ops/roles/postgresql/templates/pgsql_backup.sh.j2",
"chars": 857,
"preview": "#!/bin/bash\n\n# Halt on error\nset -e\n\nBACKUP_FILENAME=backup-`date +\\\\%Y\\\\%m\\\\%d\\\\%H.7z`\necho -e \"Dumping {{ database_nam"
},
{
"path": "ops/roles/postgresql/vars/main.yml",
"chars": 35,
"preview": "---\npostgresql_major_version: '10'\n"
},
{
"path": "ops/roles/s3cmd/meta/main.yml",
"chars": 37,
"preview": "---\ndependencies:\n- role: postgresql\n"
},
{
"path": "ops/roles/s3cmd/tasks/main.yml",
"chars": 194,
"preview": "- name: Install s3cmd\n apt: name=s3cmd state=present\n\n- name: Configure with .s3cfg file\n become: yes\n become_user: \""
},
{
"path": "ops/roles/s3cmd/templates/s3cfg.j2",
"chars": 81,
"preview": "[default]\naccess_key = {{ s3_key }}\nsecret_key = {{ s3_secret }}\nuse_https = True"
},
{
"path": "ops/roles/ssl/defaults/main.yml",
"chars": 201,
"preview": "dehydrated_install_dir: /etc/dehydrated\ndehydrated_script_name: dehydrated.sh\nchallenge_root_dir: /var/www/dehydrated\nch"
},
{
"path": "ops/roles/ssl/meta/main.yml",
"chars": 32,
"preview": "---\ndependencies:\n- role: nginx\n"
},
{
"path": "ops/roles/ssl/tasks/main.yml",
"chars": 3170,
"preview": "# Source: https://gist.github.com/raphaelm/10226edb0e46f7ce844e\n# Source: https://github.com/lukas2511/dehydrated\n---\n- "
},
{
"path": "ops/roles/ssl/templates/config.j2",
"chars": 3565,
"preview": "########################################################\n# This is the main config file for dehydrated #\n# "
},
{
"path": "ops/roles/supervisor/defaults/main.yml",
"chars": 90,
"preview": "log_file: \"/var/log/{{ app_name }}.out.log\"\nerror_file: \"/var/log/{{ app_name }}.err.log\"\n"
},
{
"path": "ops/roles/supervisor/handlers/main.yml",
"chars": 201,
"preview": "---\n- name: Reload supervisor\n become: true\n service: name=supervisor state=reloaded enabled=true\n\n- name: Reload supe"
},
{
"path": "ops/roles/supervisor/tasks/main.yml",
"chars": 514,
"preview": "---\n- name: Install Supervisor\n become: true\n apt: pkg=supervisor state=present cache_valid_time=86400\n\n- name: Setup "
},
{
"path": "ops/roles/supervisor/templates/etc_supervisor_conf.d_app_name.conf.j2",
"chars": 343,
"preview": "[program:{{ app_name }}]\ncommand=/usr/bin/dotnet {{ deploy_directory }}/api.dll\ndirectory={{ deploy_directory }}\nautosta"
},
{
"path": "package.json",
"chars": 3085,
"preview": "{\n \"name\": \"aspnet.core.react.template\",\n \"version\": \"1.0.0\",\n \"description\": \"\",\n \"main\": \"index.js\",\n \"scripts\": "
},
{
"path": "scripts/create-migration.js",
"chars": 171,
"preview": "const timestamp = Math.floor(new Date().getTime()/1000).toString();\nconst execSync = require(\"child_process\").execSync;\n"
}
]
About this extraction
This page contains the full source code of the bradymholt/aspnet-core-react-template GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 115 files (283.7 KB), approximately 88.3k tokens, and a symbol index with 135 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.