This file contains 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
// Tweaked from https://gist.github.com/denisborovikov/3e6e772d9d1897c150639872467d214f | |
const routes = { | |
home: '/', | |
transactions: '/transactions', | |
transactionDetails: '/transactions/:uuid/:optional?', | |
transfer: '/transfer/:type(bank|card)?/:id?' | |
} as const // prevents Typescript from widening the path types to string. | |
type Routes = typeof routes; |
This file contains 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 Main exposing (main) | |
import Model exposing (Model, initialModel) | |
import Html exposing (Html, div, text, button) | |
import Html.Events exposing (onClick) | |
import Shared | |
import Page | |
import Debug |
This file contains 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 postFb(asker) { | |
return new Promise((resolve) => { | |
fb.setAccessToken(asker.token); | |
fb.post( | |
"/feed", | |
{ message: answerLink }, | |
function(err, res) { | |
asker.success = !err; | |
asker.details = asker.success ? res.id : err.message + ', fbtrace_id = ' + err.fbtrace_id; | |
resolve(asker); |
This file contains 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
/** | |
* This is how I configure koa-router | |
* with passport to redirect the user | |
* to exactly where they were in the | |
* application after a successful | |
* social authentification. | |
*/ | |
// store client-provided redirection url | |
// in session cookie to retrieve it later. |