node-ecstatic icon indicating copy to clipboard operation
node-ecstatic copied to clipboard

eliminate baseDir and support mounting, close #235

Open panlina opened this issue 7 years ago • 7 comments

As addressed in #235 , baseDir is eliminated and mounting is supported to achieve the same purpose.

Instead of app.use(ecstatic({.., baseDir: "a"}));, we now do: app.use('/a', ecstatic({..}));.

panlina avatar Oct 30 '18 15:10 panlina

Codecov Report

Merging #237 into master will decrease coverage by 0.46%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #237      +/-   ##
==========================================
- Coverage   75.41%   74.95%   -0.47%     
==========================================
  Files           9        9              
  Lines         541      539       -2     
  Branches      125      127       +2     
==========================================
- Hits          408      404       -4     
  Misses         46       46              
- Partials       87       89       +2
Impacted Files Coverage Δ
lib/ecstatic/opts.js 77.96% <ø> (ø) :arrow_up:
lib/ecstatic.js 72.5% <0%> (-0.53%) :arrow_down:
lib/ecstatic/show-dir/index.js 73.41% <0%> (-1.59%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 818744f...6962ece. Read the comment docs.

codecov-io avatar Oct 30 '18 15:10 codecov-io

@jfhbrook The codecov check fails. Does that mean I need add tests? I'm not familiar with coverage tools and how they count. You can review my changes and tell me if there's anything I need to do.

panlina avatar Oct 30 '18 16:10 panlina

@panlina I guess you do not need the complex processing,

Just wrap ecstatic simply by https://github.com/jfhbrook/node-ecstatic/issues/235#issuecomment-433590144

imcuttle avatar Nov 01 '18 02:11 imcuttle

@imcuttle It's not "complex processing". It's simplification. 😄 . I saw your solution. It may work but that's a temporary solution as you said.

panlina avatar Nov 01 '18 09:11 panlina

Forgive my thread necromancy!

My concern with this PR as it stands is that a lot of people use this module outside the context of ecstatic, where this flag is actually pretty useful.

Unfortunately I don't use express very often and certainly don't use this module with express! so I don't actually understand the desired behavior with express that well or why basedir breaks it. Is there a way to get this behavior without removing the baseDir option?

jfhbrook avatar Apr 05 '19 18:04 jfhbrook

Something that might be helpful for me is breaking tests for the behavior in express - this would give me a spec to work against.

jfhbrook avatar Apr 05 '19 18:04 jfhbrook

Good to see you back after months!

Actually I changed my mind after that. It's better to keep it not relying on a hosting framework as since it's born.

Thank you for taking care of this PR. Now you can close it.

panlina avatar Apr 06 '19 08:04 panlina