Overview for 'asked'
Written by asked.io
/ Original link
on Apr. 9, 2018
My attempt at creating an optional helper.@lessworkjs/optionalLaravels optional helper can be pretty useful. With its new optional closure you can do even more.I wanted something similar in javascript so I wrote this based on my Laravel(ish) resource/transformer.You can also provide a callback that…
Written by asked.io
/ Original link
on Apr. 1, 2018
My basic attempt at javascript data transformation, resources.jscheck out the npm package, resources.jsWe‘ve gone serverless at work and we’re using my favorite, nodejs! That means a lot of javascript.I’ve been using callbacks to transform my results but I’ve become accustomed to Fractal and now La…
Written by asked.io
/ Original link
on Feb. 21, 2018
Similar to Laravels Eloquent feature.UPDATE: I’ve made this plugin a package.npm install --save bookshelf-simplepaginateUse the simplePaginate plugin to call a fetchAll and return single pages with meta data.Intended for use with large datasets as pagination with counts can be slow.Example:bookshel…
Written by asked.io
/ Original link
on Feb. 16, 2018
If you google around you’ll find plenty of examples on how-to create a custom authorizer for serverless lambda events.I used this example when I was building mine:// Return an IAM policy document for the current endpoint const effect = isAllowed ? 'Allow' : 'Deny'; const userId = user.username; con…
Written by asked.io
/ Original link
on Oct. 1, 2017
UPDATE: There is a new version of this article.Step 1: Get a Server!UPDATE: Directions updated for Ubuntu 16.04 from DigitalOcean.This example was originally written for Ubuntu 14.04.3 provided by DigitalOcean and ServerHub.Provision a new droplet, vps, server, whatever you’re using and once you ha…
Written by asked.io
/ Original link
on May. 12, 2016
TL;DR: Check out the package. I've been building an api for the past couple months and we've come to the point where the frontend needs to do some status checks. Status checks currently ping the crap out of the current api and are pretty darn slow. The solution for us is a Socket based status check…