2022-02-28 13:48:59 +05:00
|
|
|
import Database from 'notes-core/api/index';
|
2022-01-22 12:57:05 +05:00
|
|
|
import { Platform } from 'react-native';
|
2022-02-28 13:48:59 +05:00
|
|
|
import filesystem from '../filesystem';
|
|
|
|
|
import EventSource from '../sse/even-source-ios';
|
|
|
|
|
import AndroidEventSource from '../sse/event-source';
|
2020-12-20 12:48:08 +05:00
|
|
|
import Storage from './storage';
|
2020-10-13 17:02:14 +05:00
|
|
|
|
|
|
|
|
export const db = new Database(
|
2020-12-20 12:48:08 +05:00
|
|
|
Storage,
|
|
|
|
|
Platform.OS === 'ios' ? EventSource : AndroidEventSource,
|
2021-09-22 14:57:04 +05:00
|
|
|
filesystem
|
2020-10-13 17:02:14 +05:00
|
|
|
);
|
2021-10-25 13:32:14 +05:00
|
|
|
db.host(
|
|
|
|
|
__DEV__
|
|
|
|
|
? {
|
2022-04-03 01:48:44 +05:00
|
|
|
API_HOST: 'https://api.notesnook.com',
|
|
|
|
|
AUTH_HOST: 'https://auth.streetwriters.co',
|
|
|
|
|
SSE_HOST: 'https://events.streetwriters.co',
|
|
|
|
|
SUBSCRIPTIONS_HOST: 'https://subscriptions.streetwriters.co',
|
|
|
|
|
ISSUES_HOST: 'https://issues.streetwriters.co'
|
|
|
|
|
// API_HOST: 'http://192.168.10.29:5264',
|
|
|
|
|
// AUTH_HOST: 'http://192.168.10.29:8264',
|
|
|
|
|
// SSE_HOST: 'http://192.168.10.29:7264',
|
|
|
|
|
// SUBSCRIPTIONS_HOST: 'http://192.168.10.29:9264',
|
|
|
|
|
// ISSUES_HOST: 'http://192.168.10.29:2624'
|
2021-10-25 13:32:14 +05:00
|
|
|
}
|
|
|
|
|
: {
|
|
|
|
|
API_HOST: 'https://api.notesnook.com',
|
|
|
|
|
AUTH_HOST: 'https://auth.streetwriters.co',
|
|
|
|
|
SSE_HOST: 'https://events.streetwriters.co',
|
2022-01-17 10:10:04 +05:00
|
|
|
SUBSCRIPTIONS_HOST: 'https://subscriptions.streetwriters.co',
|
|
|
|
|
ISSUES_HOST: 'https://issues.streetwriters.co'
|
2021-10-25 13:32:14 +05:00
|
|
|
}
|
|
|
|
|
);
|