A Koa middleware that use github.io as image repository
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!');
})