restify / restify/node-restify

serveStatic is non-intuitive

Open
#535 33 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Help Wanted Serve
Dominant language
JavaScript
Stars
10.7k
Forks
975
Avg merge
1d 6h
Merged PRs (30d)
5

Description

KISS: Keep it simple stupid. Please make it this for static files plugins, all people have the same problem, in my ofice 5 persons give me the same as bug!!

if you assign this:

server.get(/\/docs\/public\/?.*/, restify.serveStatic({
  directory: './public'
}));

will mean that if you get the url "domain.com/docs/public" this will be load the content of "public" folder. END. Not at prefix for the entire route path... and your fairy tales... Kiss men, kiss...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the restify.serveStatic entry point and the server.get route shown in the issue; inspect how the request path is mapped to the configured directory. Done means requesting /docs/public serves the public directory contents without treating the full route path as a directory prefix.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.