-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
26 lines (21 loc) · 723 Bytes
/
index.js
File metadata and controls
26 lines (21 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
* api-ape unified entry point
*
* V3 Server Usage:
* const api = require('api-ape') // Client factory (default)
* const { ape } = require('api-ape') // Server initializer (named)
* import api, { ape } from 'api-ape' // ESM both
*
* Browser Usage:
* import api from 'api-ape' // Auto-connecting client
*/
let apiApe;
if ('undefined' === typeof window
|| 'undefined' === typeof window.document) {
// Server environment - exports: api (default), ape, broadcast, clients, createClient
apiApe = require('./server');
} else {
// Browser environment - client module has its own exports
apiApe = require('./client');
}
module.exports = apiApe