mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:23:28 +02:00
Too much overlap in storage plugin URLs for meaningful loadbalancing and config simplicity. Make poorxy emulate the real situation and change related URLs.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
var http = require('http')
|
||||
var util = require('util')
|
||||
|
||||
var express = require('express')
|
||||
|
||||
@@ -20,9 +21,14 @@ module.exports = function(options) {
|
||||
app.set('trust proxy', true)
|
||||
|
||||
app.get(
|
||||
'/s/api/v1/image/:id/*/transform'
|
||||
'/s/image/:id/:name'
|
||||
, requtil.limit(options.concurrency, function(req, res) {
|
||||
return get(req.url, options)
|
||||
var orig = util.format(
|
||||
'/s/blob/%s/%s'
|
||||
, req.params.id
|
||||
, req.params.name
|
||||
)
|
||||
return get(orig, options)
|
||||
.then(function(stream) {
|
||||
return transform(stream, {
|
||||
crop: parseCrop(req.query.crop)
|
||||
|
||||
Reference in New Issue
Block a user