Skip to content

Conversation

@KevenLi8888
Copy link
Contributor

This PR adds an environment variable NEXT_PUBLIC_BASE_PATH to provide support for deployment under a sub-path.
For example, if you're deploying to https://tools.example.com/string-is, you'll need to set NEXT_PUBLIC_BASE_PATH to /string-is.

Checklist

  • New functionality has tests.
  • README has been updated (if necessary).
  • New environment variables have been added to .env.example (if necessary).

@KevenLi8888 KevenLi8888 requested a review from recurser as a code owner December 3, 2023 14:09
@vercel
Copy link

vercel bot commented Dec 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
string-is ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2024 9:31am

@recurser
Copy link
Owner

recurser commented Jan 2, 2024

@KevenLi8888 thanks for this, and apologies for the delay! Looks good - I'll give it a test when I get a chance, but I see no reason why this can't be merged 👍

@codecov
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (f48ea51) 83.19% compared to head (216f9bd) 83.15%.
Report is 23 commits behind head on develop.

Files Patch % Lines
next.config.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1289      +/-   ##
===========================================
- Coverage    83.19%   83.15%   -0.05%     
===========================================
  Files          197      197              
  Lines         1982     1983       +1     
  Branches       465      466       +1     
===========================================
  Hits          1649     1649              
- Misses         325      326       +1     
  Partials         8        8              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@recurser
Copy link
Owner

recurser commented Jan 2, 2024

@KevenLi8888 if I try the docker-compose instructions, I get an error:

export NEXT_PUBLIC_BASE_PATH="/string-is"
docker-compose up --build
validating /Users/dave/Documents/Code/string-is/docker-compose.yml: services.string-is.build.args.0 must be a string

I'm a bit of a docker-compose noob - can we make that arg optional ?

@KevenLi8888
Copy link
Contributor Author

@recurser Thank you for pointing that out! I've added a default blank value for this environment variable and tested it locally. Could you please double-check and see if the problem resolved? Thanks!

recurser pushed a commit that referenced this pull request Jan 3, 2024
recurser pushed a commit that referenced this pull request Jan 3, 2024
@recurser
Copy link
Owner

recurser commented Jan 3, 2024

@KevenLi8888 thanks for this! 🙏 I've rebased and merged it but for some reason it didn't close the PR - closing.

@recurser recurser closed this Jan 3, 2024
github-actions bot pushed a commit that referenced this pull request Jan 3, 2024
## [1.36.0](v1.35.4...v1.36.0) (2024-01-03)

### Features

* [[#1289](#1289)] support for deployment under a sub-path ([51d61e7](51d61e7))

### Bug Fixes

* [[#1142](#1142)] resolve prettier type versions ([af7176a](af7176a))
* [[#1308](#1308)] fix jest setup after upgrade ([05ece6c](05ece6c))
* [[#1313](#1313)] fix flakey time tests ([804bb42](804bb42))

### Dependencies

* bump @compiled/react from 0.16.2 to 0.16.8 ([50d0dc4](50d0dc4))
* bump chrono-node from 2.7.0 to 2.7.4 ([14cd632](14cd632))
* bump prettier and @types/prettier ([15feef5](15feef5))
* bump terser from 5.24.0 to 5.26.0 ([48da8fc](48da8fc))
github-actions bot pushed a commit that referenced this pull request Jan 3, 2024
## [1.36.0](v1.35.4...v1.36.0) (2024-01-03)

### Features

* [[#1289](#1289)] support for deployment under a sub-path ([51d61e7](51d61e7))

### Bug Fixes

* [[#1142](#1142)] resolve prettier type versions ([af7176a](af7176a))
* [[#1308](#1308)] fix jest setup after upgrade ([05ece6c](05ece6c))
* [[#1313](#1313)] fix flakey time tests ([804bb42](804bb42))
* add missing packages ([d36a6e9](d36a6e9))

### Dependencies

* bump @compiled/react from 0.16.2 to 0.16.8 ([50d0dc4](50d0dc4))
* bump chrono-node from 2.7.0 to 2.7.4 ([14cd632](14cd632))
* bump prettier and @types/prettier ([15feef5](15feef5))
* bump terser from 5.24.0 to 5.26.0 ([48da8fc](48da8fc))
github-actions bot pushed a commit that referenced this pull request Jan 3, 2024
## [1.37.0](v1.36.0...v1.37.0) (2024-01-03)

### Features

* [[#1289](#1289)] support for deployment under a sub-path ([51d61e7](51d61e7))

### Bug Fixes

* [[#1142](#1142)] resolve prettier type versions ([af7176a](af7176a))
* [[#1308](#1308)] fix jest setup after upgrade ([05ece6c](05ece6c))
* [[#1313](#1313)] fix flakey time tests ([804bb42](804bb42))
* add missing packages ([d36a6e9](d36a6e9))
* use the browser location when constructing the share URL ([59f93d3](59f93d3))

### Dependencies

* bump @compiled/react from 0.16.2 to 0.16.8 ([50d0dc4](50d0dc4))
* bump chrono-node from 2.7.0 to 2.7.4 ([14cd632](14cd632))
* bump prettier and @types/prettier ([15feef5](15feef5))
* bump terser from 5.24.0 to 5.26.0 ([48da8fc](48da8fc))
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