Closed Damnum closed 6 years ago
We made a minor API change about the useMiddlewares
now it is a start param called middlewares
import { BasicServer } from 'realm-object-server'
import * as path from 'path'
import * as cors from 'cors'
const server = new BasicServer()
server.start({
// This is the location where ROS will store its runtime data
dataPath: path.join(__dirname, '../data')
middlewares: [cors()]
})
.then(() => {
console.log(`Realm Object Server was started on ${server.address}`)
})
.catch(err => {
console.error(`Error starting Realm Object Server: ${err.message}`)
})
Ok thanks, that works now.
Glad to have helped
can I get any synced data from the middleware and put it on anywhere I want ?
Goals
Build ROS via NPM using
npm run-script build
My
./src/index.ts
looks like this:Expected Results
Build is successful.
Actual Results
Build throws error:
error TS2339: Property 'useMiddleware' does not exist on type 'Server'
Steps to Reproduce
My setup follows the steps provided in the docs: https://realm.io/docs/realm-object-server/latest/#custom-middlewares
Why does
Server.useMiddleware
not exist?Version of Realm and Tooling