hexo-info-api

0.2.0 • Public • Published

Hexo Info Api

 

中文文档

Install

# npm
npm install hexo-info-api --save

# yarn
yarn add hexo-info-api

Config

add the following to _config.yml

hexo_info_api:
  allowOrigin: "*" # Set to "*" to allow all origins (Access-Control-Allow-Origin)
  enable: # enable what api u need
  - getInfo
  - getPostCount
  - getPosts
  - getPostsByCategory
  - getPostsByCategoryId
  - getPostsByTag
  - getPostsByTagId
  - getPostByPath
  - getPostById
  - getCategories
  - getTags
  - getLatestPost
  - getLatest5Posts
  # Disable default api(host:port/api/) default: false
  disable_default_api: false 

Run (Test)

hexo s

#Open http://localhost:4000/api/ to see what api u enabled

Result

This is the result of the GET /api/getPostCount endpoint.

{
    "type": "getPostCount",
    "data": {
        "count": 0
    }
}

Other api response is similar to this.

You can see all the api in hexo-info-api wiki

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.09latest

Version History

VersionDownloads (Last 7 Days)Published
0.2.09
0.1.21
0.1.10
0.1.01
0.0.50
0.0.40
0.0.30
0.0.10

Package Sidebar

Install

npm i hexo-info-api

Weekly Downloads

11

Version

0.2.0

License

MIT

Unpacked Size

20.3 kB

Total Files

18

Last publish

Collaborators

  • jz0ojiang