https://github.com/pouchdb/pouchdb-fauxton-logic
https://github.com/pouchdb/pouchdb-fauxton-logic
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pouchdb/pouchdb-fauxton-logic
- Owner: pouchdb
- Created: 2014-10-20T11:32:12.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2021-11-10T14:26:48.000Z (over 4 years ago)
- Last Synced: 2024-04-12T18:02:37.144Z (over 2 years ago)
- Language: JavaScript
- Size: 1.09 MB
- Stars: 7
- Watchers: 7
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
pouchdb-fauxton-logic
=====================
[](https://travis-ci.org/pouchdb/pouchdb-fauxton-logic)
This repository contains the JavaScript that's added to
[pouchdb-fauxton-base](https://github.com/marten-de-vries/pouchdb-fauxton-base)
to make a working version of Fauxton running on top of PouchDB.
It does that by injecting a mock XHR object in the Fauxton page, which
converts all requests made by Fauxton into
[CouchDB request objects](http://docs.couchdb.org/en/latest/json-structure.html#request-object).
These are then converted to PouchDB method calls by
[pouchdb-route](https://www.npmjs.org/package/pouchdb-route). The result
is a [CouchDB response object](http://docs.couchdb.org/en/latest/json-structure.html#response-object),
which is returned by the mock xhr object as the response to the request.
Demo
----
https://ma.rtendevri.es/fauxton/
Tests
-----
npm install #first time only
npm test
Building
--------
First, make sure the `/fauxton` directory contains the result of a build
of [pouchdb-fauxton-base](https://github.com/marten-de-vries/pouchdb-fauxton-base).
There are different ways to build PouchDB-Fauxton. The basic one is:
npm install #first time only
npm run build
Put the `/fauxton` directory somewhere on a web server, and that's it!
If you want to build a version of pouchdb-fauxton for use in a Firefox
add-on or Chrome extension, check out their
[respective](https://github.com/marten-de-vries/pouchdb-fauxton-firefox-addon)
[repositories](https://github.com/marten-de-vries/pouchdb-fauxton-chrome-extension)
for information on that.