avnpc
v1.14.2
Published
API of avnpc.com based on EvaEngine.js
Downloads
22
Readme
avnpc.js
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
- Setup a github hexo repo like:
hexo init avnpc.content
- Run avnpc.js server with database
- Sync hexo repo posts to database once by command
node build/cli.js sync:github:db
- 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
topublished: 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