- install dnsmasq
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
- edit
/usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
/* | |
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace | |
so it's better encapsulated. Now you can have multiple random number generators | |
and they won't stomp all over eachother's state. | |
If you want to use this as a substitute for Math.random(), use the random() | |
method like so: | |
var m = new MersenneTwister(); |
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
/usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
service: my-service | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
stage: ${opt:stage, 'dev'} | |
environment: | |
REDIS_HOST: | |
"Fn::GetAtt": [ElasticCacheCluster, RedisEndpoint.Address] | |
functions: |
This middleware does a few interesting things:
url
shape in the zustand store, where we'll store URL information.url
state slice in the ?state
search parameter after it has been stringified and base 64 encoded.?state
search parameter into the url
slice of our store.?state
search parameter with the new url
state slice.popstate
and re-decodes the state from the URL into our store.Even though you should generally use a CDN for something like this, a very simple setup for smaller static websites on a VPS / VM is fine.
This gist comes with an example Caddyfile
that can be used with caddy to serve any sub-folder in the /var/www
path as a subdomain.
This reduces the overall effort required to create and register domains if you are going to keep it all on the same server.
The example Caddyfile
shows how to set the flow up with the localhost
domain but changing it to work with an actual domain should be rather simple and is documented as comments in the file.