EXPRESS API ACTIONS GENERATOR

How ShowAll Endpoint Gets Generated

First, you have Express boilerplate code architecture that contains the basic server setup and project structure. After setting up the boilerplate, the next step is to install the **Express API Actions Generator** extension in VS Code. Once the extension is installed, you begin building the backend structure step by step. Using the extension commands, you first create the `Api` folder, then add the `v1` version structure, and configure the router setup. After completing the routing structure, you add the table name, such as `journals`, and the extension automatically starts generating the required backend architecture around it.


You generated a code architecture containing Api, v1, and journals. Now you want to add the ShowAll functionality, which is used to fetch all the data stored in the JSON files inside the data folder. Here, the question is: How do you add the ShowAll functionality? This is the step-by-step process you need to follow.


First, open the end-points.js file inside the journals module. At the top-right corner, you will see a menu containing different API generation commands.In that you will see the get command ,Click on the Get button, and the extension will automatically generate the complete ShowAll architecture, including routes, controllers, services, endpoint registration, and the JSON response flow required to retrieve all records from storage.

Api/V1/journals/end-points.js
Api/
 └── V1/
      └── routes.js

STEP 3 — Generate journals Table Route

Open

Api/V1/routes.js

Click

AddTableName

Enter

journals

Generated:

Api/
 └── V1/
      └── journals/
           ├── Config/
           ├── routes.js
           └── end-points.js

Now click on end-points.js. A popup command menu appears at the top.

get
insert
delete
alter

When you click the get command, the extension automatically generates the ShowAll endpoint architecture.

Api/
 └── V1/
      └── journals/
           ├── Config/
           ├── ShowAll/
           │    ├── controller.js
           │    ├── service.js
           │    └── errors.js
           │
           │
           ├── end-points.js
           └── routes.js

Commands Shown Inside end-points.js

After opening end-points.js, the extension displays CRUD action commands at the top. These commands generate different API architectures automatically.

get
insert
delete
alter

What Happens When You Click get?

The get command generates the ShowAll endpoint architecture automatically. The extension creates backend layers for reading all records from the journals table.

1

Generate ShowAll Folder

The extension automatically creates the ShowAll folder inside the journals module.

2

Create controller.js

The controller handles requests and sends JSON responses back to the browser.

3

Create service.js

The service layer contains business logic and reads JSON table data.

4

Register Endpoint

The extension automatically creates the GET endpoint inside end-points.js.

Generated ShowAll Architecture

After clicking get, the extension generates the following modular Express.js backend structure.

Api/
   V1/
      journals/

         Config/

         ShowAll/
            controller.js
            service.js
            errors.js

         end-points.js

      routes.js

routes.js
GET http://localhost:3000/Api/V1/journals/ShowAll

ShowAll Endpoint Execution Flow

The request travels through multiple Express.js layers before returning JSON data.

Browser

User calls ShowAll endpoint.

routes.js

Main Express router receives the request.

end-points.js

Generated ShowAll endpoint gets executed.

controller.js

Processes request and response handling.

service.js

Reads journals JSON records from storage.

JSON Response

Records returned back to frontend application.

Why This Architecture Matters

The extension focuses on modular Express.js backend generation with clean architecture principles.

Automatic API Generation

Generate complex backend structures instantly instead of manually writing repetitive Express.js code.

Layered Backend Design

Separate routing, controllers, services, and storage logic into clean backend layers.

Scalable CRUD Architecture

Use the same architecture for Insert, Alter, Delete, and ShowAll API actions.

Professional Express Structure

Organize large backend applications using modular route and endpoint generation.