2020-12-20 12:48:08 +05:00
|
|
|
import {Platform} from 'react-native';
|
|
|
|
|
import Storage from './storage';
|
|
|
|
|
import EventSource from 'rn-eventsource';
|
|
|
|
|
import AndroidEventSource from './event-source';
|
|
|
|
|
import Database from 'notes-core/api/index';
|
2021-09-22 14:57:04 +05:00
|
|
|
import filesystem from './filesystem';
|
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-02-23 11:47:43 +05:00
|
|
|
|
|
|
|
|
db.host( __DEV__ ? {
|
2021-09-22 14:57:04 +05:00
|
|
|
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',
|
2021-01-20 09:05:12 +05:00
|
|
|
} : {
|
2021-01-03 16:01:39 +05:00
|
|
|
API_HOST: 'https://api.notesnook.com',
|
|
|
|
|
AUTH_HOST: 'https://auth.streetwriters.co',
|
|
|
|
|
SSE_HOST: 'https://events.streetwriters.co',
|
2021-08-09 14:04:28 +05:00
|
|
|
SUBSCRIPTIONS_HOST: 'https://subscriptions.streetwriters.co',
|
2020-12-20 12:48:08 +05:00
|
|
|
});
|