CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/project/http-api/testing.js
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
require("ts-node").register({
7
project: __dirname + "/../tsconfig.json",
8
cacheDirectory: "/tmp",
9
});
10
11
const client = {
12
secret_token: "secret",
13
project_id: "e11c1abe-52a0-4959-ac1a-391e14088bf5",
14
async get_syncdoc_history(string_id, patches) {
15
return [{ string_id, this_is_fake: true }];
16
},
17
dbg(name) {
18
return (...args) => {
19
console.log(name, ...args);
20
};
21
},
22
};
23
24
async function start() {
25
try {
26
await require("./server.ts").start_server({
27
port: 8080,
28
port_path: "/tmp/port",
29
client,
30
});
31
} catch (err) {
32
console.log(`EXCEPTION -- ${err}`);
33
console.trace();
34
}
35
}
36
37
start();
38
39