Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

NGN.NET Constants (Extension?) #22

Closed
coreybutler opened this issue Nov 16, 2017 · 1 comment
Closed

NGN.NET Constants (Extension?) #22

coreybutler opened this issue Nov 16, 2017 · 1 comment

Comments

@coreybutler
Copy link
Member

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.
@coreybutler
Copy link
Member Author

Kamino closed and cloned this issue to ngnjs/NGN

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant