A minimalistic Discussion Board API with NodeJS, Express, Knex (sqlite), Joi and Swagger.
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
.
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:
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
After performing this action, you get the authentication token as an answer:
Copy the token, go to the top of the page, and click on the "Authorize" button.
With this token, you can access other API calls, such as "/get_hello_world_auth" or edit/delete Categories, Suppliers etc...
The database used is sqlite3. You can use SQLite Viewer
extension in the VSCode