aboutsummaryrefslogtreecommitdiff
path: root/index.ts
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-06-09 14:16:15 +0300
committereug-vs <eug-vs@keemail.me>2020-06-09 14:16:15 +0300
commite9d0438f6c02664c652a593c686564361fa0de6b (patch)
tree5bc0a1e78cf72c6e1ae48f5ee3954511748c81b1 /index.ts
parent24f0d8709fc5e90a92d9c3940e693f76cd653bf4 (diff)
downloadwhich-api-e9d0438f6c02664c652a593c686564361fa0de6b.tar.gz
refactor: structurize feathers app
Diffstat (limited to 'index.ts')
-rw-r--r--index.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/index.ts b/index.ts
new file mode 100644
index 0000000..35d1411
--- /dev/null
+++ b/index.ts
@@ -0,0 +1,14 @@
+import app from './app';
+
+// Add any new real-time connection to the `everybody` channel
+app.on('connection', connection =>
+ app.channel('everybody').join(connection)
+);
+// Publish all events to the `everybody` channel
+app.publish(data => app.channel('everybody'));
+
+
+app.listen(3030).on('listening', () =>
+ console.log('Feathers server listening on localhost:3030')
+);
+