🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

nextjs-routes-docs

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nextjs-routes-docs

Generate docs for nextjs routes

0.0.61
latest
npm
Version published
Weekly downloads
43
72%
Maintainers
1
Weekly downloads
 
Created
Source

NextJS Routes Docs

Automatically generate Swagger Docs for your NextJS project.

  • NextJS Routes Docs

For information about terms used in this document see: terminology

Execute

npx nextjs-routes-docs [dir]

Options

npx nextjs-routes-docs --help
Usage: npx nextjs-routes-docs [dir]

Arguments:
  dir                   Nextjs project directory

Options:
  -V, --version         output the version number
  -t, --text            Produce text docs
  -s, --swagger         Produce swagger docs
  -p, --params          [BETA] Parse code to get params
  -o, --output <value>  Choose output folder
  -h, --help            display help for command

Example output

Swagger: routes.yml

swagger: '2.0'
info:
  title: Swagger API
  version: 1.0.0
paths:
  /api/room/join:
    post:
      parameters:
        - in: body
          name: roomId
        - in: body
          name: user
  /api/room/update:
    post:
      parameters:
        - in: body
          name: roomId
        - in: body
          name: roomName
        - in: body
          name: roomSize
  /api/room:
    post:
      parameters:
        - in: body
          name: roomId
        - in: body
          name: createdBy
    get:
      parameters:
        - in: query
          name: roomId
    delete:
      parameters:
        - in: query
          name: roomId
  /api/user:
    post:
      parameters:
        - in: body
          name: userId
        - in: body
          name: userName
    get:
      parameters:
        - in: query
          name: userId

Plain text: routes

C:\Users\Tedis\Desktop\src\nextjs-project\pages\api\room\join.js
POST 	 /api/room/join 	 {body: {roomId, user}}
---------------------------------
C:\Users\Tedis\Desktop\src\nextjs-project\pages\api\room\update.js
POST 	 /api/room/update 	 {body: {roomId, roomName, roomSize}}
---------------------------------
C:\Users\Tedis\Desktop\src\nextjs-project\pages\api\room.js
POST 	 /api/room 	 {body: {roomId, createdBy}}
GET 	 /api/room 	 ?roomId
DELETE 	 /api/room 	 ?roomId
---------------------------------
C:\Users\Tedis\Desktop\src\nextjs-project\pages\api\user.js
POST 	 /api/user 	 {body: {userId, userName}}
GET 	 /api/user 	 ?userId
---------------------------------

Support

  • Crete an an issue in the public Github
  • Email hey@tedis.me

Keywords

nextjs

FAQs

Package last updated on 17 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts