GitbookIO / nuts

:chestnut: Releases/downloads server with auto-updater and GitHub as a backend
http://nuts.gitbook.com
Apache License 2.0
1.25k stars 300 forks source link

Is there support for differential downloads? #176

Open aniketbiprojit opened 3 years ago

aniketbiprojit commented 3 years ago

The thing is I have an app which has binaries over 700MB. Can't ask user to update that much data everytime.

Cannot download differentially, fallback to full download: Error: Content-Type "multipart/byteranges" is expected, but got "application/octet-stream"

This is what I am using:

require('dotenv').config()
const express = require('express')
const { init, get_latest_yml, get_latest_blockmaps } = require('./api')
const Nuts = require('nuts-serve').Nuts

const app = express()

app.use(express.json())

const nuts = Nuts({
    repository: 'aftershootco/AfterShoot-Electron',
    token: process.env.GH_TOKEN,
})

app.get('/myapp/download/win/AfterShoot-win-*.exe', (req, res) => {
    res.redirect('/myapp/download/win/')
})

app.get('/myapp/download/mac/AfterShoot-mac-*.dmg', (req, res) => {
    res.redirect('/myapp/download/mac/')
})

app.use(
    '/myapp',
    (req, res, next) => {
        console.log(req.url)
        next()
    },
    nuts.router
)
app.listen(80)

Or is this happening due to redirect?

dopry commented 1 year ago

Nuts doesn't support differential downloads, unless you're using nuget/nupkg and generating deltas. differential downloads are typically package format specific. nuts is just a release server... You can check out my fork if you're looking for something currently maintained, https://github.com/dopry/pecans I'm also on the look out for additional maintainers.