├── package.json └── server ├── start.js └── views └── index.html /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fxa-example-web-rp", 3 | "version": "0.0.0", 4 | "description": "An example web RP for Firefox Accounts", 5 | "author": "Mozilla (https://mozilla.org)", 6 | "license": "MPL 2.0", 7 | "scripts": { 8 | "start": "node server/start.js" 9 | }, 10 | "dependencies": { 11 | "express": "3.4.7", 12 | "nunjucks": "1.0.1" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /server/start.js: -------------------------------------------------------------------------------- 1 | /* This Source Code Form is subject to the terms of the Mozilla Public 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 | 5 | const express = require('express'); 6 | const nunjucks = require('nunjucks'); 7 | const path = require('path'); 8 | 9 | const VIEWS_PATH = path.join(__dirname, 'views'); 10 | 11 | var app = express(); 12 | var env = new nunjucks.Environment(new nunjucks.FileSystemLoader(VIEWS_PATH)); 13 | env.express(app); 14 | 15 | app.get('/', function(req, res) { 16 | res.render('index.html', { 17 | fxa_include_url: "http://localhost:3030/include.js", 18 | fxa_signup_url: "http://localhost:3030/signup", 19 | fxa_signin_url: "http://localhost:3030/signin" 20 | }); 21 | }); 22 | 23 | 24 | app.listen(3000); 25 | 26 | -------------------------------------------------------------------------------- /server/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Firefox Accounts Example Web RP 7 | 8 | 9 | 10 |

Firefox Accounts Example Web RP

11 | 12 | Sign up 13 | Sign in 14 | 15 |

Result

16 |
17 | 18 | 38 | 39 | 40 | 41 | --------------------------------------------------------------------------------