Skip to content

Base for an ASP.NET core web api. Includes auth, mysql connection and dapper

Notifications You must be signed in to change notification settings

drum445/DotNetTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Prereqs

Local instance of MySQL/MariaDB (run dbinit.sql)
Local install of dotnet core

Running

First time

$ dotnet restore

Dev

$ dotnet run dev

Prod

$ sudo ./backend

Building

$ dotnet publish -c Release -r ubuntu.18.04-x64

Endpoints

Todo

View tasks
GET: http://localhost:5000/api/todo

Create new task and insert into db
POST: http://localhost:5000/api/todo

{
	"title": "Task title",
	"body": "task description"
}

Update task
PUT: http://localhost:5000/api/todo/:todoId

{
	"title": "Task title",
	"body": "task description"
}

Delete task
DELETE: http://localhost:5000/api/todo/:todoId

Person

Check if user is logged in, if so return username
GET: http://localhost:5000/api/person

Attempt to login
POST: http://localhost:5000/api/person

{
	"username": "drum",
	"password": "password"
}

Register
POST: http://localhost:5000/api/person/register

{
	"username": "drum",
	"password": "password"
}

Logout user and clear session
POST: http://localhost:5000/api/person/logout

About

Base for an ASP.NET core web api. Includes auth, mysql connection and dapper

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages