Skip to content

Minimal ASP.NET Core JSON API. Data secured with json web tokens, JWT, and ASP.Net Core Identity membership system for login.

License

Notifications You must be signed in to change notification settings

soixantseize/aspnetcore-api-jwt-identity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

BareMetalApi

WHAT

ASP.Net Core JSON API that is lightweight, minimal MVC, and cross-platform, no IIS. Create, read, update, and write to your PostgreSQL database out of the box thanks to Npgsql driver and EF Core dependency injection. Includes data migration script that runs on startup and seeds initial data. Get started right away!

WHY

I loved the simplicity and portability of spinning up a RESTful app built on NodeJS and Express, only to yearn for the possibility in .NET so that I could write code in C# and leverage tools like Entity Framework, LINQ, Async Await. Hello .NET Core now makes it possible!

HOW

Disclaimer

This project borrows heavily from the following repos:

  1. ToDoApi blog post here

  2. BareMetalApi blog post here

  3. Weapsy blog post here

Prerequisites

  1. Install .NET Core (https://www.microsoft.com/net/core)
    • Successfull launches on Windows (Windows7), Mac (OSX 10.11.13), and Linux (CentOS 7.2.1511)
  2. Install PostgreSQL (https://www.postgresql.org/)
    • Successfull CRUD operations on Windows (PostgreSQL 9.4.5) and Mac (PostgreSQL 9.5.2)
  3. Update lines 22 and 23 in the file Data/ApplicationDbContext.cs with your PostgreSQL user name and password

To run application

  1. Download repository
  2. Open command prompt and navigate to repository
  3. Run command "dotnet restore"
    • Please create new issue if you are having trouble downloading dependencies
  4. Run command "dotnet run"
  5. Use Postman to send JSON GET, POST, PUT, and DELETE requests.
    • GET http://localhost:5000/blog/blogarticle
      {
      "Id": 1,
      "ArticleTitle": "How to Dabb",
      "ArticleContent": "First tuck you head down..."
      },
      {
      "Id": 2,
      "ArticleTitle": "How to Whip",
      "ArticleContent": "Rock back and forth..."
      },
      {
      "Id": 3,
      "ArticleTitle": "How to Nae Nae",
      "ArticleContent": "Add a connecting move..."
      },
      {
      "Id": 4,
      "ArticleTitle": "How to Dougie",
      "ArticleContent": "Pass your hand through..."
      },
      {
      "Id": 5,
      "ArticleTitle": "How to Wop",
      "ArticleContent": "Worm your upper body..."
      }

    • GET http://localhost:5000/blog/blogarticle/3
      {
      "Id": 3,
      "ArticleTitle": "How to Nae Nae",
      "ArticleContent": "Add a connecting move..."
      }

    • POST http://localhost:5000/blog/blogarticle
      {"ArticleTitle":"How to Running Man","ArticleContent":"Lift your right foot and..."}

    • PUT http://localhost:5000/blog/blogarticle/4
      {"ArticleTitle":"How to Moonwalk","ArticleContent":"Place one foot directly..."}

    • DELETE http://localhost:5000/blog/blogarticle/5

About

Minimal ASP.NET Core JSON API. Data secured with json web tokens, JWT, and ASP.Net Core Identity membership system for login.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%