Skip to content

Wavewash patch 1#835

Merged
micahr merged 3 commits intomasterfrom
wavewash-patch-1
Jun 17, 2015
Merged

Wavewash patch 1#835
micahr merged 3 commits intomasterfrom
wavewash-patch-1

Conversation

@micahr
Copy link
Copy Markdown
Contributor

@micahr micahr commented Jun 16, 2015

Adds a test for @Wavewash's change in #719

Also fix up the JSCS errors.

Closes #719

Wavewash and others added 2 commits June 16, 2015 16:02
When using restify moving from express, I found sending a static file of which I knew the direct path to difficult when I was trying to map a route to it which did not contain the filename in it.

For example in express:

app.get('/cool', function (req, res) {
  res.sendFile("../public/coolindex.html");
}

the proposed change:
By sending a "file" option now with the serveStatic call you can serve a file which does not have its' filename present in the req.path there by mapping routes to static files.

Example usage:
app.get('/logins',
    restify.serveStatic({
      directory: './public',
      file: 'login.html'
    })
  );
@micahr micahr force-pushed the wavewash-patch-1 branch from 3abe756 to d484e68 Compare June 17, 2015 00:00
@Wavewash
Copy link
Copy Markdown
Contributor

Thanks for doing this! I've been swamped.

micahr added a commit that referenced this pull request Jun 17, 2015
Update plugins/static.js to allow for serving static files that do not use the route as a path
@micahr micahr merged commit d2ca569 into master Jun 17, 2015
@micahr micahr deleted the wavewash-patch-1 branch June 17, 2015 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants