Giter VIP home page Giter VIP logo

adonisjs-api's Introduction

AdonisJs REST API with CRUD and Model Relationships covered.

Guide

  • Follow the steps below to get started first go to AdonisJS Instalation
  • Clone the project to your local machine.
  • Copy .env.example to .env
  • Update the database connection details.
  • Then serve the application using node ace serve --watch

Sample Responses

// post request http://127.0.0.1:3333/api/register
{
	"name":"Test User",
	"email":"[email protected]",
	"password":"12345678"
}

// response
{
  "type": "bearer",
  "token": "MQ.x7zYvG1uZr1VgW1bZB2BEiGJpYgXRit7dCmgD2DXdoyvhG0WQH4FtoWIc2CE",
  "expires_at": "2021-06-18T16:29:26.629+03:00"
}

// post request http://127.0.0.1:3333/api/forums
{
	"title":"Forum One",
	"description":"Hello forum one"
}

// response
{
  "user_id": 1,
  "title": "Forum One",
  "description": "Hello forum one",
  "created_at": "2021-06-08T16:38:47.882+03:00",
  "updated_at": "2021-06-08T16:38:47.882+03:00",
  "id": 1
}

// post request http://127.0.0.1:3333/api/posts
{
	"forum_id":1,
	"title":"Post One",
	"content":"Hello post one"
}

// response 

{
  "user_id": 1,
  "title": "Post One",
  "content": "Hello post one",
  "forum_id": 5,
  "created_at": "2021-06-08T16:47:17.951+03:00",
  "updated_at": "2021-06-08T16:47:17.951+03:00",
  "id": 1
}

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.