Code Monkey home page Code Monkey logo

test_fcamara_api's Introduction

Test_FCamara_API

This is a simple FCamara test

Obs

This API use:

  • CQRS pattern: entity framqord to write and Dapper to read;
  • jwt Bearer authentication;
  • Sql Server;

Prerequisites

  • .net core framework installed;
  • Entity framework installed(FCamara.infra project and FCamara.API project);
  • If the FCamara.infra throw some exeption ina query, install the Dapper package

Getting Started

Setup your Sql Server connection string at ...\src\FCamara.Shared\Runtime.cs and ...\src\FCamara.Api\appsettings.json

Create database:

  • Set the FCamara.Infra project as "startup project";

  • Write in Package Manager Console: Enable-migrations -> Add-migration v1 -> Update-database ;

  • Verify if the dabase was created;

  • Verify if the tables is seeded

  • Setup the FCamara.Api project as "startup project";

  • Run with FCamara.Api Server(kestrel server);

Users

username: italo

password: nest@123

Expiration timeout

Default expiration timeout: 1 minute.

You can change it in FCamara.API project on Security folder in TokenOptions.cs, just change the ValidFor propertie.

Routes

By deafault the server(kestrel) is ruinnig at port 5000.

/v1/register/user

Crate users in database.

Type: Post

Required authentication: no

HEADERS: "Content-Type":"application/json"

FromBody:

{
  "username":"someUserName",
  "password":"SomePassWord"
}

v1/authenticate/user"

Authenticate a user in login.

Type: Post

Required authentication: no

HEADERS: "Content-Type":"application/json"

FromForm:

{
 "username":"someUserName",
 "password":"password"
}

v1/get/products

List all database products

Type: Get

Required authentication: yes

HEADERS:

"Content-Type":"application/json"
"Autorization":"Bearer eyJhbGciOiJIU..."

test_fcamara_api's People

Contributors

italojs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.