2013-11-16 03:12:50 +04:00
# Firefox Accounts Content Server
2013-07-31 03:08:38 +04:00
2015-05-25 18:40:48 +03:00
[![Build Status: Travis ](https://travis-ci.org/mozilla/fxa-content-server.svg?branch=master )](https://travis-ci.org/mozilla/fxa-content-server)
2016-11-01 20:47:59 +03:00
[![Build Status: Circle CI ](https://circleci.com/gh/mozilla/fxa-content-server.svg?style=shield )](https://circleci.com/gh/mozilla/fxa-content-server)
2014-08-21 03:33:35 +04:00
[![Coverage Status ](https://img.shields.io/coveralls/mozilla/fxa-content-server.svg )](https://coveralls.io/r/mozilla/fxa-content-server)
2013-08-29 04:18:09 +04:00
2016-03-16 07:50:22 +03:00
Static server that hosts [Firefox Account sign up ](https://accounts.firefox.com ), sign in, email verification, etc. flows.
2013-07-31 18:23:08 +04:00
2017-10-17 13:58:37 +03:00
* [Quick Start ](#quick-start )
* [Development Notes ](#development-notes )
* [Changes to Stylesheets ](#changes-to-stylesheets )
* [Changes to Scripts and Templates ](#changes-to-scripts-and-templates )
* [Testing ](#testing )
* [Prerequisites ](#prerequisites )
* [Setup ](#setup )
* [Grunt Commands ](#grunt-commands )
* [Servers ](#servers )
* [License ](#license )
2016-07-26 04:24:13 +03:00
## Quick Start
2013-09-14 02:13:59 +04:00
2016-07-26 04:24:13 +03:00
Clone the repository, make sure you have [required prerequisites ](https://github.com/mozilla/fxa-local-dev#dependencies ) installed.
Run `npm install` and `npm run start-remote` .
This will start a local fxa-content-server on [http://127.0.0.1:3030 ](http://127.0.0.1:3030 ) that works with remote Firefox Accounts servers.
2015-06-03 23:15:48 +03:00
2016-07-26 04:24:13 +03:00
If you want to install all Firefox Accounts servers locally follow the instructions on:
[fxa-local-dev ](https://github.com/mozilla/fxa-local-dev ) to get a full development setup running.
Please note that fxa-local-dev is the preferred way of contributing to Firefox Accounts.
2013-09-14 02:13:59 +04:00
2016-07-26 04:24:13 +03:00
## Development Notes
2014-09-09 07:27:53 +04:00
2016-06-28 22:54:42 +03:00
### Changes to stylesheets
2016-07-26 04:24:13 +03:00
To have the css resources automatically rebuilt after changes, run `grunt sass watch` .
Now whenever a change is made to the `.scss` files, the corresponding css resources will be rebuilt.
2016-06-28 22:54:42 +03:00
### Changes to scripts and templates
Any changes made to the scripts or the template files will automatically be reflected on page refresh.
2013-08-31 01:45:46 +04:00
## Testing
2017-10-17 13:58:37 +03:00
### Prerequisites
2014-09-09 07:27:53 +04:00
* Java JDK or JRE (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
2013-09-17 21:57:03 +04:00
### Setup
2013-08-01 00:32:47 +04:00
2014-09-09 07:27:53 +04:00
To run tests locally with Selenium:
2013-07-31 18:23:08 +04:00
2014-05-24 00:33:26 +04:00
```sh
npm test
```
2013-08-01 21:07:41 +04:00
2014-09-09 07:27:53 +04:00
To change the default auth server edit `server/config/*.json` on your deployed instance.
2013-09-05 03:54:25 +04:00
2014-05-24 00:33:26 +04:00
```json
{
2014-06-18 04:34:22 +04:00
"fxaccount_url": "http://your.auth.server.here.org"
2014-05-24 00:33:26 +04:00
}
```
2013-12-10 21:10:46 +04:00
2015-02-18 06:16:13 +03:00
**Note that testing with Selenium via Docker does *not* work at present, so all testing must be carried out via your normal operating system's npm & Java tooling.**
2013-12-10 21:10:46 +04:00
## Grunt Commands
[Grunt ](http://gruntjs.com/ ) is used to run common tasks to build, test, and run local servers.
2014-05-24 00:33:26 +04:00
| TASK | DESCRIPTION |
|------|-------------|
2014-07-28 23:56:04 +04:00
| `grunt build` | build production resources. See [task source ](grunttasks/build.js ) for more documentation |
2014-05-24 00:33:26 +04:00
| `grunt clean` | remove any built production resources. |
2016-07-21 04:37:39 +03:00
| `grunt lint` | run ESLint, Sass-lint, amdcheck and JSONLint on client side and testing JavaScript. |
2016-06-28 22:54:42 +03:00
| `grunt sass watch` | rebuild css resources automatically when changes are made to the `.scss` files (file needs to be saved). |
2014-05-24 00:33:26 +04:00
| `grunt server` | run a local server running on port 3030 with development resources. |
| `grunt server:dist` | run a local server running on port 3030 with production resources. Production resources will be built as part of the task. |
2014-05-24 00:52:07 +04:00
| `grunt test` | run local Intern tests. |
2014-05-24 00:33:26 +04:00
| `grunt version` | stamp a new minor version. Updates the version number and creates a new CHANGELOG.md. |
| `grunt version:patch` | stamp a new patch version. Updates the version number and creates a new CHANGELOG.md. |
2013-12-10 21:10:46 +04:00
2014-01-15 19:28:42 +04:00
## Servers
2014-05-24 00:33:26 +04:00
* latest development - https://latest.dev.lcip.org/
2016-07-26 04:24:13 +03:00
* content - https://content.dev.lcip.org/
2016-01-12 18:46:19 +03:00
* stable - https://stable.dev.lcip.org/
2014-01-15 19:28:42 +04:00
* stage - https://accounts.stage.mozaws.net/
* production - https://accounts.firefox.com/
2013-12-10 21:10:46 +04:00
2013-12-10 03:22:13 +04:00
## License
MPL 2.0
2017-10-02 21:46:33 +03:00