-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from jsonjoy-com/ops
Ops
- Loading branch information
Showing
7 changed files
with
635 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
// Run: npx ts-node src/json-crdt-server/main-http1.ts | ||
// curl localhost:9999/rpc -H 'Content-Type: rpc.rx.compact.json' -d '[1,1,"util.ping"]' | ||
|
||
import {createCaller} from './routes'; | ||
import {Services} from './services/Services'; | ||
import {createCaller, createServices} from './routes'; | ||
import {RpcServer} from '../../server/http1/RpcServer'; | ||
|
||
export type JsonJoyDemoRpcCaller = ReturnType<typeof createCaller>['caller']; | ||
|
||
const server = RpcServer.startWithDefaults({ | ||
port: +(process.env.PORT || 9999), | ||
caller: createCaller(new Services()).caller, | ||
logger: console, | ||
}); | ||
const main = async () => { | ||
const services = await createServices(); | ||
const server = RpcServer.startWithDefaults({ | ||
port: +(process.env.PORT || 9999), | ||
caller: createCaller(services).caller, | ||
logger: console, | ||
}); | ||
|
||
// tslint:disable-next-line:no-console | ||
console.log(server + ''); | ||
// tslint:disable-next-line:no-console | ||
console.log(server + ''); | ||
}; | ||
|
||
// tslint:disable-next-line no-console | ||
main().catch(console.error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.