Skip to content

NGN.NET Constants (Extension?) #6

Description

@coreybutler

From ngn-core created by coreybutler : ngnjs/ngn-core#22

A library of constants may help simplify network requests. This would likely be best as an extension to NGN instead of a core element of the library, since it is not required to make a network request.

Just a few examples:

  • NGN.NET.PORT.HTTP refers to port 80
  • NGN.NET.PORT.HTTPS & NGN.NET.PORT.TLS refer to port 443
  • NGN.NET.PORT.LDAP refers to port 53
  • NGN.NET.PORT.SLDAP refers to port 686
  • NGN.NET.PORT.SSH refers to port 21
  • NGN.NET.PORT.SMTP refers to port 25

These could also be aliased with friendly names like NGN.NET.PORT.EMAIL which could refer to the SMTP port.

The purpose of these constants is to simplify network connectivity for developers who are less familiar with common port values.

Additionally, HTTP status code constants/references may be useful.

A few examples include:

  • NGN.NET.STATUS.OK refers to 200.
  • NGN.NET.STATUS.SUCCESS refers to 2XX.
  • NGN.NET.STATUS.FAILURE refers to 4XX and 5XX.
  • NGN.NET.STATUS.DENIED refers to 401.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions