Last active
March 11, 2018 17:20
-
-
Save graphicbeacon/f3b3640158445b9b63e450cd1e5be7f8 to your computer and use it in GitHub Desktop.
How to create an application using the Monzo Bank API
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
const express = require('express'); | |
const request = require('request'); | |
const app = express(); | |
const oauthDetails = { | |
client_id: '[your client id]', | |
client_secret: '[your client secret]', | |
redirect_uri: 'http://localhost:3000/oauth/callback' | |
}; | |
// Will be populated once received | |
let accessToken = null; | |
app.get('/', (req, res) => { | |
const { client_id, redirect_uri } = oauthDetails; | |
const monzoAuthUrl = 'https://auth.monzo.com'; | |
res.type('html'); | |
res.send(` | |
<h1>Hello</h1> | |
<form action="${monzoAuthUrl}"> | |
<input type="hidden" name="client_id" value="${client_id}" /> | |
<input type="hidden" name="redirect_uri" value="${redirect_uri}" /> | |
<input type="hidden" name="response_type" value="code" /> | |
<button>Sign in</button> | |
</form> | |
`); | |
}); | |
app.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment