Coder Social home page Coder Social logo

discussionboard-api's Introduction

Discussion Board API

A minimalistic Discussion Board API with NodeJS, Express, Knex (sqlite), Joi and Swagger.

Database
Swagger

Install

git clone https://github.com/danielschmitz/discussionboard-api.git
cd discussionboard-api
npm install
npm run migrate
npm run dev

Go to localhost:3001/api-docs. (The port number is set in the src/config.js file)

Atfer the installation, you can always run the server using the npm run dev command.

Se você precisar recriar o banco de dados, delete o arquivo dev.sqlite3 e execute novamente o comando npm run migrate.

How get the Authorization Token

To make some calls to the API, you must be logged in. To do this, go to the /auth/login row in swagger and click on the "Try it Out" button:

Image Example

The swagger setup already comes with the email and password information for user 1. Thus, you do not need to provide any information. Just click the "Execute" button

Image Example

After performing this action, you get the authentication token as an answer:

Image Example

Copy the token, go to the top of the page, and click on the "Authorize" button.

Image Example

With this token, you can access other API calls, such as "/get_hello_world_auth" or edit/delete Categories, Suppliers etc...

Database

The database used is sqlite3. You can use SQLite Viewer extension in the VSCode

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.