这是indexloc提供的服务,不要输入任何密码
Skip to content

Consider using URL instead of string for URLs in our config. #3361

@sodic

Description

@sodic

Version: 0.19.0
Strongly related: #3359

Our config contains several URLs and they are all strings (frontendUrl, databaseUrl, serverUrl, apiUrl, etc.). Whenever we want to do something with them, we call new URL and go from there.

Why not create URL objects as soon as possible and just save those inside the config? Like this

  // ...
  databaseUrl: URL;
  frontendUrl: URL;
  serverUrl: URL;

Benefits:

  • We'd have a much easier time parsing the URL once and then working with URL objects than we do calling new URL in a bunch of places.
  • It solves all problems described in Have a proper type for URLs we validated #3359.
  • It would probably benefit our users too.

The task:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions