avnpc

1.14.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i avnpc

Weekly Downloads

2

Version

1.14.2

License

MIT

Unpacked Size

98.2 kB

Total Files

70

Last publish

Collaborators

  • allovince