Files
notesnook/apps/mobile/src/utils/DB.js

23 lines
645 B
JavaScript
Raw Normal View History

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';
2020-10-13 17:02:14 +05:00
global.Buffer = require('buffer').Buffer;
export const db = new Database(
2020-12-20 12:48:08 +05:00
Storage,
Platform.OS === 'ios' ? EventSource : AndroidEventSource,
2020-10-13 17:02:14 +05:00
);
2020-12-20 12:48:08 +05:00
2021-01-20 09:05:12 +05:00
db.host( __DEV__ ? {
2021-02-20 15:03:02 +05:00
API_HOST: 'http://192.168.10.6:5264',
AUTH_HOST: 'http://192.168.10.6:8264',
SSE_HOST: 'http://192.168.10.6:7264',
2021-01-20 09:05:12 +05:00
} : {
API_HOST: 'https://api.notesnook.com',
AUTH_HOST: 'https://auth.streetwriters.co',
SSE_HOST: 'https://events.streetwriters.co',
2020-12-20 12:48:08 +05:00
});