avnpc

API of avnpc.com based on EvaEngine.js

Stats

StarsIssuesVersionUpdatedCreatedSize
avnpc
001.14.23 years ago4 years agoMinified + gzip package size for avnpc in KB

Readme

avnpc.js

Build Status Dependencies Status License

Backend API for avnpc.com

A pure node.js blog micro service

  • API style: both support RESTFul / GraphQL
  • Blog posts content be able to store in a github repo (hexo compatibled) or an Evernote account

Deployment

  1. Setup a github hexo repo like: hexo init avnpc.content
  2. Run avnpc.js server with database
  3. Sync hexo repo posts to database once by command node build/cli.js sync:github:db
  4. Create a github webhook, set http://avnpcjs_project/v1/github/hook as Payload URL

How to use

Create a post:

  • Write a post by hexo new post "new post title" -s "new-post-slug"
  • Commit and push to github
  • That's all

Update a post:

  • Update hexo file on github

Remove a post:

  • Change hexo file meta info from: published: true to published: false

Development

make pre-build
make install
cp config/default.js config/config.local.development.js

Change database configs due to your local environment

make migrate

After database ready, run web server by

npm run dev
npm run swagger-dev

Visit RESTFul API by http://localhost:15638/

Visit GraphQL API by http://localhost:3000/v1/graphql/ui

How to test webhook

brew cask install ngrok
ngrok http 3000

replace github payload to ngrok domain

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.