This is a sample post

 

The api methods



This blog post provide the api methods:

API Methods:

getPosts

@params

{
    pageNo?: number, //default = 1
    maxResult?: number //default = 6
}

Response:

{
    status: boolean,
    data?: {
        id: string,
        title: string,
        published: string,
        updated: string,
        category?: string[],
        thumbnail?: string,
        content?: string,
        summary?: string
    }[],
    isNextpage?: boolean
}

getPostById

@params

{
    id: string //post Id
}

Response:

{
    status: boolean,
    data?: {
        id: string,
        title: string,
        published: string,
        updated: string,
        category?: string[],
        thumbnail?: string,
        content?: string,
        summary?: string
    }
}

getPages

@params

{
    pageNo?: number, //default = 1
    maxResult?: number //default = 6
}

Response:

{
    status: boolean,
    data?: {
        id: string,
        title: string,
        published: string,
        updated: string,
        category?: string[],
        thumbnail?: string,
        content?: string,
        summary?: string
    }[],
    isNextpage?: boolean
}

getPageById

@params

{
    id: string //page Id
}

Response:

{
    status: boolean,
    data?: {
        id: string,
        title: string,
        published: string,
        updated: string,
        category?: string[],
        thumbnail?: string,
        content?: string,
        summary?: string
    }
}

searchInPosts

@params

{
    term: string //search term
}

Response:

{
    status: boolean,
    data?: {
        id: string,
        title: string,
        published: string,
        updated: string,
        category?: string[],
        thumbnail?: string,
        content?: string,
        summary?: string
    }[],
}

Author:

avatar

📜 License

MIT

🛠 Requirements

  • Node.js >=14.0.0
  • TypeScript >=5.0
  • ESM-only environments

🎉 Happy 

Post a Comment

Previous Post Next Post