node.js - Restify and semver wildcards -


question: how specify wildcard semvar in accept-version header? (restify 2.5.0)

the goal: accept 1.x.x. looking @ documentation looks achieved setting semver ~1 or 1.x. restify not seem handle this.

server:

  var server = restify.createserver({             version: '1.1.0',... 

route:

  server.get({                     path: /^\/([a-za-z0-9_\.~-]+)\/(.*)/,                     version: '1.x' // tried '~1'             },             function(req, res, next){                     req.log.debug(req.params,'request');                     res.send(req.params);     }); 

the result:

{"code":"invalidversion","message":"* not supported /sys/blah"} 

i able working setting routes version '1.0.5'(example in range) , specifying clients accept-version ~1, however, seems better suited set wildcard on server side. ideas?

the server should authority version exposing doesn't make sense fuzzy/reasonable close (using tilde prefix).

restify using semver exposing versions (more node-semver) ~1 isn't valid version. you've discovered, client can ask specific version or ask range.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -