You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constexpress=require('express')constaddon=express()addon.get('/:someParameter/manifest.json',function(req,res){res.send({id: 'org.parametrized.'+req.params.someParameter,name: 'add-on for '+req.params.someParameter,resources: ['stream'],types: ['series'],})})addon.get('/:someParameter/stream/:type/:id.json',function(req,res){// @TODO do something depending on req.params.someParameterres.send({streams: []})})addon.listen(19999,function(){console.log('http://127.0.0.1:19999')})
What this example is missing, in comparison to building with the SDK:
linting of the manifest
parsing of extra
more convenient API
Also, you can always construct a new SDK instance depending on req.params.someParameter, but that will be expensive in terms of resource usage
make an add-on that has different behaviors on different URL prefixes
e.g. for a wrapper add-on, it would take the ID of the add-on you wanna wrap in the URL params
e.g.
/foo/manifest.json
and/bar/manifest.json
get handled by the same functions but with different paramThe text was updated successfully, but these errors were encountered: