This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function layout(params) { | |
let {body, _url, title} = params | |
return ` | |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset=utf-8> | |
<meta name=viewport content=width=device-width,initial-scale=1,shrink-to-fit=no> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | |
<title>${title}</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const arc = require('@architect/functions') | |
const layout = require('@architect/shared/views/bootstrap') | |
function route(req, res) { | |
let html = layout({ | |
title: 'My App', | |
body: ` | |
<div class=jumbotron> | |
<h1 class=display-4>Add to Slack</h1> | |
<p class=lead>Install this app to start using it in Slack.</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function bootstrap(params) { | |
let {body, title} = params | |
return ` | |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset=utf-8> | |
<meta name=viewport content=width=device-width,initial-scale=1,shrink-to-fit=no> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | |
<title>${title}</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function interpolateParams(req) { | |
var params = /\{\w+\}/g | |
if (params.test(req.path)) { | |
var matches = req.path.match(params) | |
var vars = matches.map(a=> a.replace(/\{|\}/g, '')) | |
var idx = 0 | |
matches.forEach(m=> { | |
req.path = req.path.replace(m, req.params[vars[idx]]) | |
idx += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint no-undef: "off", no-restricted-globals: "off" */ | |
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.slack=f()}})(function(){var define,module,exports;return(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){},{}],2:[function(require,module,exports){var api=require('./api.json') | |
module.exports=function _bind(ns,exec){Object.keys( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
lambdas=`ls src/json` | |
for f in $lambdas | |
do | |
cd "src/json/$f" | |
npm i --production | |
cd ../../../ | |
done | |
lambdas=`ls src/html` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Slack = require('slack') | |
const token = process.env.SLACKBOT_TOKEN | |
const bot = new Slack({token}) | |
let result = await bot.api.test({hello:'world'}) | |
console.log(result) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var params = { | |
DistributionConfig: { /* required */ | |
CallerReference: 'STRING_VALUE', /* required */ | |
Comment: 'STRING_VALUE', /* required */ | |
DefaultCacheBehavior: { /* required */ | |
ForwardedValues: { /* required */ | |
Cookies: { /* required */ | |
Forward: none | whitelist | all, /* required */ | |
WhitelistedNames: { | |
Quantity: 0, /* required */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app | |
testapp | |
@html | |
get / |