• Stars
    star
    244
  • Rank 165,885 (Top 4 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created almost 12 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🐶 Hapi plugin for Hoodie’s server core module

hoodie-server

Hapi plugin for Hoodie’s server core module

Build Status Coverage Status Dependency Status devDependency Status

@hoodie/server integrates Hoodie’s server core modules:

Example

var Hapi = require('hapi')
var hoodie = require('@hoodie/server')
var PouchDB = require('pouchdb-core').plugin(require('pouchdb-mapreduce')).plugin(require('pouchdb-adapter-memory'))

var server = new Hapi.Server()
server.connection({
  host: 'localhost',
  port: 8000
})

server.register({
  register: hoodie,
  options: { // pass options here
    PouchDB: PouchDB,
    paths: {
      public: 'dist'
    }
  }
}, function (error) {
  if (error) {
    throw error
  }

  server.start(function (error) {
    if (error) {
      throw error
    }

    console.log(('Server running at:', server.info.uri))
  })
})

Usage

option default description
adminPassword - Password to login with admin account
paths.data '.hoodie' Data path
paths.public 'public' Public path
PouchDB PouchDB constructor. See also custom PouchDB builds.
account {} Hoodie Account Server options. account.admins are generated based on adminPassword option above. account.usersDb is hardcoded to _users at this point. account.secret is stored in hoodie-store/hoodie and will be generated if it does not yet exist.
store {} Hoodie Store Server options. store.couchdb, store.PouchDB are set based on the PouchDB option above. store.hooks.onPreAuth is set to bind user authentication for Hoodie Account to Hoodie Store.

Testing

Local setup

git clone https://github.com/hoodiehq/hoodie-server.git
cd hoodie-server
npm install

Run all tests

npm test

Contributing

Have a look at the Hoodie project's contribution guidelines. If you want to hang out you can join our Hoodie Community Chat.

License

Apache 2.0

More Repositories

1

hoodie

🐶 The Offline First JavaScript Backend
JavaScript
4,371
star
2

first-timers-bot

A friendly bot that helps onboarding new Open Source Contributors
JavaScript
265
star
3

hoodie-app-mapchat

An open source, offline capable, map based demo app.
JavaScript
115
star
4

hoodie-app-tracker

Default Hoodie App
JavaScript
103
star
5

camp

🎪 Welcome to Hoodie Camp!
HTML
99
star
6

hood.ie

🐶 Hoodie Website
HTML
74
star
7

pouchdb-hoodie-api

🐶 Hoodie-like API for PouchDB
JavaScript
43
star
8

account-json-api

REST-API Blueprint for all things user accounts and sesions
API Blueprint
35
star
9

hoodie-client

🐶 Client API for the Hoodie server
JavaScript
34
star
10

hoodie-css

Framework for all hoodie sites
CSS
30
star
11

editorial

📙 The home of the Hoodie Editorial Team
23
star
12

hoodie-account-server

🐶 Account JSON API backed by PouchDB
JavaScript
22
star
13

pouchdb-hoodie-sync

🐶 Hoodie-like sync API for PouchDB
JavaScript
21
star
14

hoodie-app-skeleton

Boilerplate for a new Hoodie App
HTML
18
star
15

ember-hoodie

Build awesome offline-first Ember apps with Hoodie!
JavaScript
17
star
16

hoodie-admin

🐶 Hoodie Admin core module
JavaScript
13
star
17

faq

Frequently asked questions about Hoodie
JavaScript
11
star
18

hoodie-account-client

🐶 Account client API for the browser
JavaScript
11
star
19

slack-irc-duplex

JavaScript
10
star
20

hoodie-camp-tutorial

Tutorial for latest Hoodie Camp Release
HTML
9
star
21

couchdb-calculate-session-id

calculates valid CouchDB session IDs using username, salt, secret & timestamp
JavaScript
9
star
22

discussion

General discussions and questions about Hoodie
7
star
23

hoodie-store-server

🐶 CouchDB APIs for storing JSON data and sync
JavaScript
7
star
24

pouchdb-admins

PouchDB plugin to simulate CouchDB’s admin accounts
JavaScript
7
star
25

pouchdb-users

PouchDB plugin to simulate CouchDB’s _users database behavior
JavaScript
7
star
26

hoodie-plugin-hello-world

A sample Hoodie plugin
JavaScript
5
star
27

hoodie-connection-status

🐶 connection status API for the browser
JavaScript
5
star
28

hoodie-task

⛔ WORK IN PROGRESS - Showcase of a standalone server using only Task Client/Server
JavaScript
4
star
29

hoodie-store-server-api

API to manage databases, access and replications, backed by PouchDB
JavaScript
4
star
30

hoodie-log

🐶 log API for the browser
JavaScript
4
star
31

hoodie-account-server-api

🐶 Account JavaScript API backed by PouchDB
JavaScript
3
star
32

try.hood.ie

1, 2, … Hoodie!
CSS
3
star
33

hoodie-task-client

client api for asynchronous task queue, using PouchDB for sync
JavaScript
2
star
34

hoodie-admin-client

🐶 Client Admin API for the Hoodie server
JavaScript
2
star
35

hoodie-task-server

⛔ WORK IN PROGRESS - Hoodie’s background Task queue backend
JavaScript
1
star