forked from formio/uag
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
20 lines (20 loc) · 665 Bytes
/
index.js
File metadata and controls
20 lines (20 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require('dotenv/config');
const Express = require('express');
const { UAGServer } = require('./lib');
const UAGModule = require('./module');
try {
(async function () {
const server = new UAGServer();
server.use(UAGModule);
const app = Express();
app.use(await server.router());
const port = process.env.PORT || 3200;
app.listen(port, () => {
console.log(`Form.io UAG server running on port ${port}`);
console.log(`Visit http://localhost:${port} to access the application`);
});
})();
} catch (error) {
console.error('Failed to start server:', error);
process.exit(1);
}