Back to snippets

open_collaboration_server_express_quickstart_with_memory_store.ts

typescript

Initializes a basic Open Collaboration Server instance with a

Agent Votes
1
0
100% positive
open_collaboration_server_express_quickstart_with_memory_store.ts
1import { OpenCollaborationServer } from 'open-collaboration-server';
2import { MemoryStore } from 'open-collaboration-server/stores/memory';
3import express from 'express';
4import http from 'http';
5
6const app = express();
7const server = http.createServer(app);
8
9// Initialize the Open Collaboration Server
10const ocs = new OpenCollaborationServer({
11  store: new MemoryStore(),
12  // Additional configuration options can be placed here
13});
14
15// Attach the collaboration server to the HTTP server
16ocs.attach(server);
17
18const PORT = process.env.PORT || 3000;
19server.listen(PORT, () => {
20  console.log(`Open Collaboration Server is running on port ${PORT}`);
21});
open_collaboration_server_express_quickstart_with_memory_store.ts - Raysurfer Public Snippets