Skip to content

Write server URL to a temporary file when starting Rails

Created by: andyw8

Co-authored with @vinistock

Expose the server URL so that external tools are able to know where the server is running.

One example would be for an LSP implementation, so that introspection of the server can be provided.

Detail

Write the file as part of the server initialization.

Additional information

This could be a step towards implementing ruby-lsp-rails as a built-in Rails feature.

Questions

Should we delete the server_url.txt file when the server is shutdown? If so, where in the code would that be done?

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Merge request reports