Page MenuHomePhabricator

[server][docs] new migration to fix baseRoutePath on localhost
ClosedPublic

Authored by varun on Mar 30 2022, 2:39 PM.
Tags
None
Referenced Files
F3401556: D3577.diff
Mon, Dec 2, 12:44 PM
Unknown Object (File)
Sun, Nov 10, 12:12 AM
Unknown Object (File)
Sun, Nov 10, 12:12 AM
Unknown Object (File)
Sun, Nov 10, 12:12 AM
Unknown Object (File)
Sun, Nov 10, 12:06 AM
Unknown Object (File)
Tue, Nov 5, 1:24 AM
Unknown Object (File)
Oct 29 2024, 5:29 AM
Unknown Object (File)
Oct 10 2024, 10:39 AM

Details

Summary

migration 0 in migrations.js broke server locally. per the dev environment docs, apache proxies /comm/ to http://localhost:3000/. however, by setting baseRoutePath to basePath, the server was only serving requests for the app at http://localhost:3000/comm/. this diff introduces a new migration to fix commapp_url.json and squadcal_url.json by setting baseRoutePath to /. i've also updated the dev environment docs with the correct baseRoutePath.

Test Plan

ran the migration a few times and checked that:

  1. if the baseDomain is not "http://localhost", the file is ignored
  2. if the baseRoutePath is missing, it's added and set to "/" (this is redundant since migration 0 makes sure baseRoutePath exists, but just to be safe...)
  3. if the baseRoutePath is present, it's changed to "/"

after testing the migration, i also confirmed that i could access the web app locally

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 30 2022, 2:44 PM
Harbormaster failed remote builds in B7734: Diff 10848!
varun requested review of this revision.Mar 30 2022, 2:48 PM

Please address inline comment before landing

server/src/database/migrations.js
38–47 ↗(On Diff #10848)

This code is messy. It seems like you've made it more complicated than it needs to be, maybe partly due to Flow, but partly from not exiting early. See proposed edit

This revision is now accepted and ready to land.Mar 30 2022, 6:56 PM

addressing feedback to simplify code

This revision was landed with ongoing or failed builds.Mar 30 2022, 7:51 PM
This revision was automatically updated to reflect the committed changes.