Servicio rest con fastify cors, helmet, rate limit, autoload
import Fastify from 'fastify'
import { dirname, join } from 'path'
import { fileURLToPath } from 'url'
import AutoLoad from 'fastify-autoload'
node_modules | |
dist | |
yarn.lock |
Notes on working with Hasura & Postgres docker containers in a local mac environment.
Table of content:
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<p class="title">Web Assembly Example</p> |
const decoder = new TextDecoder('utf-8'); | |
let text:string; | |
let lines:string[]; | |
try { | |
text = decoder.decode(await Deno.readFile("./test.txt")) | |
lines = text.split("\n") | |
} catch(e) { | |
console.error(e) | |
Deno.exit(1) |
/** | |
* node --max-old-space-size=4048 --initial-old-space-size=4048 --max-heap-size=4048 stress-memory | |
* x64 | |
* rss 3.39 GB | |
* heapTotal 3.74 GB | |
* heapUsed 3.73 GB | |
*/ | |
const os = require('os') | |
console.log(os.arch()) |
class HashMap { | |
constructor() { | |
this.map = {} | |
} | |
hash(k) { | |
return k % 10 | |
} | |
class Node { | |
constructor(value) { | |
this.value = value | |
this.links = [] | |
} | |
linkTo(node, weight) { | |
this.links.push(new Link(this, weight, node)) | |
} |
module.exports = class Stack { | |
data = [] | |
maxSize | |
constructor(initialData, maxSize = -1) { | |
this.data = Array.isArray(initialData) ? initialData : (typeof initialData == "undefined" ? [] : [initialData]) | |
this.maxSize = maxSize | |
} | |
isFull() { |