Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 1.15 KB

README.md

File metadata and controls

36 lines (26 loc) · 1.15 KB

githubAsImageServer

Build Status undefined

A Koa middleware that use github.io as image repository

usage

 npm i github-as-image-server -S
const Koa = require('koa')
const app = new Koa()

const githubAsImageServer = require('../lib');

app.use(githubAsImageServer({
  targetDir: `D:/project/silentport.github.io`, // local path of git repo
  repo: 'https://github.com/silentport/silentport.github.io.git', // address of git repo
  url: 'https://silentport.github.io', // host of your github.io
  dir: 'upload', // dirname will save image
  project: 'blog', // child dirname will save image
  router: '/upload' // path of request
}))


app.listen(8002, () => {
  console.log('server is started!');
})