Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[now dev] Render directory listing for Now v2 projects #2528

Merged
merged 5 commits into from
Jul 11, 2019

Conversation

TooTallNate
Copy link
Member

Before directory listings only worked for "all static" deployments since now dev would shell out to serve-handler to do the rendering.

Now the directory listing rendering logic is moved into now dev which allows projects with Lambdas to also serve the directory listing (previously they would just 404).

This removes the special-casing of "all static" deployments so that there's only one code path.

Fixes #2161.
Fixes #2417.

Before directory listings only worked for "all static" deployments since
`now dev` would shell out to `serve-handler` to do the rendering.

Now the directory listing rendering logic is moved into `now dev` which
allows projects with Lambdas to also serve the directory listing
(previously they would just 404).

This removes the special-casing of "all static" deployments so that
there's only one code path.

Fixes #2161.
Fixes #2417.
@codecov-io
Copy link

codecov-io commented Jul 11, 2019

Codecov Report

Merging #2528 into canary will decrease coverage by 0.19%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##           canary    #2528     +/-   ##
=========================================
- Coverage   13.21%   13.01%   -0.2%     
=========================================
  Files         256      256             
  Lines        9384     9357     -27     
  Branches     1076     1061     -15     
=========================================
- Hits         1240     1218     -22     
+ Misses       8022     8019      -3     
+ Partials      122      120      -2
Impacted Files Coverage Δ
src/util/dev/server.ts 63.78% <83.33%> (+3.35%) ⬆️
src/util/metrics.ts 61.53% <0%> (-17.78%) ⬇️
src/util/dev/builder-cache.ts 70.4% <0%> (-8.93%) ⬇️
src/util/dev/static-builder.ts 93.75% <0%> (+18.75%) ⬆️

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 2de9ede...c8096c6. Read the comment docs.

@TooTallNate TooTallNate merged commit 5d329e0 into canary Jul 11, 2019
@TooTallNate TooTallNate deleted the add/now-dev-directory-listing branch July 11, 2019 02:34
AndyBitz pushed a commit that referenced this pull request Jul 12, 2019
* [now dev] Render directory listing for Now v2 projects

Before directory listings only worked for "all static" deployments since
`now dev` would shell out to `serve-handler` to do the rendering.

Now the directory listing rendering logic is moved into `now dev` which
allows projects with Lambdas to also serve the directory listing
(previously they would just 404).

This removes the special-casing of "all static" deployments so that
there's only one code path.

Fixes #2161.
Fixes #2417.

* Move `serve-handler/src/directory` types to root

* Set `Content-Length` header for dir listing

* Add unit tests for directory listing

* Fix unit test
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.

[now dev] Routes don't work when there is only one static builder specified show the entire directory
2 participants