aboutsummaryrefslogtreecommitdiff
path: root/vnext/server/index.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-05-31 06:10:51 +0300
committerGravatar Vitaly Takmazov2023-05-31 06:11:05 +0300
commitf2a7ea3af919548d41383734e8a3667086a44bcc (patch)
treee0d9db07956f10ccc4e27fc9e0d45d88950dbfbb /vnext/server/index.js
parent395185d093b2d6bb46d02830088e00a3a2ca20c1 (diff)
eslint: enforce semicolons only before statement continuation chars
Diffstat (limited to 'vnext/server/index.js')
-rw-r--r--vnext/server/index.js64
1 files changed, 32 insertions, 32 deletions
diff --git a/vnext/server/index.js b/vnext/server/index.js
index 5bfa9070..8eb86981 100644
--- a/vnext/server/index.js
+++ b/vnext/server/index.js
@@ -1,53 +1,53 @@
-import express from 'express';
-import { raw } from 'body-parser';
-import cors from 'cors';
-import config from 'config';
-import debug from 'debug';
-const log = debug('http');
-
-import serverRenderer from './middleware/renderer';
-import event from './middleware/event';
-import oembed from './middleware/oembed';
-import urlExpand from './middleware/urlexpand';
-
-const PORT = 8081;
-import path from 'path';
-import { webhook, webhookPath } from './durov';
+import express from 'express'
+import { raw } from 'body-parser'
+import cors from 'cors'
+import config from 'config'
+import debug from 'debug'
+const log = debug('http')
+
+import serverRenderer from './middleware/renderer'
+import event from './middleware/event'
+import oembed from './middleware/oembed'
+import urlExpand from './middleware/urlexpand'
+
+const PORT = 8081
+import path from 'path'
+import { webhook, webhookPath } from './durov'
// initialize the application and create the routes
-const app = express();
-app.use(raw());
-app.use(cors());
-const router = express.Router();
+const app = express()
+app.use(raw())
+app.use(cors())
+const router = express.Router()
-router.post('/api/sender', event);
-router.get('/api/oembed', oembed);
-router.get('/api/urlexpand', urlExpand);
+router.post('/api/sender', event)
+router.get('/api/oembed', oembed)
+router.get('/api/urlexpand', urlExpand)
-const durov_webhook = webhookPath();
+const durov_webhook = webhookPath()
if (durov_webhook) {
- router.post(`/api/${durov_webhook}`, webhook);
+ router.post(`/api/${durov_webhook}`, webhook)
}
-router.use('^/$', serverRenderer);
+router.use('^/$', serverRenderer)
-const STATIC_ROOT = config.get('service.static_root') || path.resolve(__dirname, 'public');
+const STATIC_ROOT = config.get('service.static_root') || path.resolve(__dirname, 'public')
// other static resources should just be served as they are
router.use(express.static(
STATIC_ROOT,
{ maxAge: '30d' },
-));
+))
-router.use('*', serverRenderer);
+router.use('*', serverRenderer)
-app.use(router);
+app.use(router)
// start the app
app.listen(PORT, (error) => {
if (error) {
- return console.log('something bad happened', error);
+ return console.log('something bad happened', error)
}
- log('listening on ' + PORT + '...');
-});
+ log('listening on ' + PORT + '...')
+})