Skip to content

Instantly share code, notes, and snippets.

View lukasredev's full-sized avatar

Lukas Reichling lukasredev

  • Zurich Switzerland
View GitHub Profile
@montanaflynn
montanaflynn / kong-dns.md
Last active March 2, 2022 12:46
Example of using Kong with DNS

Kong

Kong is a powerful proxy built on nginx. By taking a request and passing it to an upstream server and then returning the result to the client Kong can perform his magic. To know which requests go to which service Kong looks for a Host header to match against. There's a few other ways Kong can match requests to services but for now that's the most basic route. Pun intended.

Start

Assuming everything has been installed and setup, such as dependencies and config files which can be found in the docs, it's time to turn Kong on. The first time Kong runs you'll see some Kong config values and initial migrations to the datastore.

kong start
@justmoon
justmoon / custom-error.js
Last active April 22, 2024 17:19 — forked from subfuzion/error.md
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);