Install Babun http://babun.github.io/
Install Hyper http://hyper.is/
Download Fira Code font https://github.com/tonsky/FiraCode
| // Chi-like syntactic sugar layer on top of stdlib http.ServeMux. | |
| package main | |
| import ( | |
| "net/http" | |
| "slices" | |
| ) | |
| type ( | |
| middleware func(http.Handler) http.Handler |
| Server { | |
| Port = 8080 | |
| SourceRoot = /var/www/foobar/public/ | |
| } | |
| VirtualHost { | |
| * { | |
| Pattern = .* | |
| RewriteRules { | |
| * { |
| /** | |
| * Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
| * It was requested to be introduced at as part of the jsonwebtoken library, | |
| * since we feel it does not add too much value but it will add code to mantain | |
| * we won't include it. | |
| * | |
| * I create this gist just to help those who want to auto-refresh JWTs. | |
| */ | |
| const jwt = require('jsonwebtoken'); |
Install Babun http://babun.github.io/
Install Hyper http://hyper.is/
Download Fira Code font https://github.com/tonsky/FiraCode
| /* eslint-env jest */ | |
| import _ from 'lodash' | |
| import path from 'path' | |
| import fs from 'fs' | |
| import callsites from 'callsites' | |
| import knex from 'knex' | |
| import hash from 'object-hash' | |
| import conf from '<conf>' | |
| // Get the db config. |
Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.
As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:
| import React, { PureComponent } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import { Async } from 'react-select'; | |
| // UI. | |
| import { withStyles } from 'material-ui/styles'; | |
| import { FormControl } from 'material-ui/Form'; | |
| import { InputLabel } from 'material-ui/Input'; | |