trongtuyen96 / atwt-api

An API backend server with refined SwaggerUI for testing purpose.

Home Page:https://atwt-api.herokuapp.com/api-docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


background rest api
ATWT Rest API

An REST API for testing purpose using Nodejs, Expressjs and hosted on Heroku with MongoDB Atlas. Document specification powered by SwaggerUI.

Table of Contents

Changelogs

  • Update 26/06/2021: Add GET methods with multiple conditions for all endpoints (Swagger docs updated)
  • Update 25/06/2021: Add GET methods with multiple conditions
  • Update 24/06/2021: Add PUT methods for objects
  • Update 30/06/2021: Add Docker file

Endpoints

There are 6 endpoint groups available now:

  1. User

    /user : Get users with conditions

    /user : Create a user

    /user : Update existing user

    /user/{userId} : Get specific user

    /user/{userId} : Delete a user - Disabled

    /user/{userId}/cars : Get cars of user

  2. Car

    /car : Get cars with conditions

    /car : Create a car

    /car : Update existing car

    /car/{carId} : Get specific car

    /car/{carId} : Delete a car

  3. Factory

    /factory : Get factories with conditions

    /factory : Create a factory

    /factory : Update existing factory

    /factory/{factoryId} : Get specific factory

    /factory/{factoryId} : Delete a factory - Disabled

    /factory/{factoryId}/foods : Get foods produced by factory

  4. Food

    /food : Get foods with conditions

    /food : Create food

    /food : Update food

    /food/{foodId} : Get specific food

    /food/{foodId} : Delete food

  5. Zoo

    /zoo : Get zoos with conditions

    /zoo : Create a zoo

    /zoo : Update a zoo

    /zoo/{zooId} : Get specific zoo

    /zoo/{zooId} : Delete a zoo - Disabled

    /zoo/{zooId}/animals : Get animals live in zoo

  6. Animal

    /animal : Get animals with conditions

    /animal : Create an animal

    /animal : Update an animal

    /animal/{animalId} : Get specific animal

    /animal/{animalId} : Delete animal

How to use

Direct request via base URL

e.g: To get all animals

https://atwt-api.herokuapp.com/v1/animal

Manual execution via swaggerUI

Give it a try:

background

Docker Usage

Docker build image

docker build . -t atwt-api

Docker list images

docker images

Docker run

docker run -d -p 3000:3000 --name atwtapi atwt-api

-d for running background mode (not attached to current session)
-p for specfiying in and out ports
--name for specifying container name

Docker list containers

docker container ls

Docker stop container

docker stop atwtapi

Docker remove container

docker rm atwtapi

Docker remove images

docker rmi atwt-api

Author

Tuyen Nguyen - QA Automation Engineer

License

Copyright 2020 Tuyen Nguyen

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

About

An API backend server with refined SwaggerUI for testing purpose.

https://atwt-api.herokuapp.com/api-docs/

License:Apache License 2.0


Languages

Language:JavaScript 99.0%Language:Dockerfile 1.0%Language:Procfile 0.1%