mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-11 04:48:32 +03:00
Clean master commit
This commit is contained in:
31
src/index.js
Executable file
31
src/index.js
Executable file
@@ -0,0 +1,31 @@
|
||||
import http from "http";
|
||||
import express from "express";
|
||||
import initialize from "./initialize";
|
||||
import middleware from "./middleware";
|
||||
import api from "./api";
|
||||
import config from "./config";
|
||||
|
||||
let app = express();
|
||||
app.server = http.createServer(app);
|
||||
|
||||
initialize(controller => {
|
||||
app.use(
|
||||
middleware({
|
||||
config,
|
||||
controller
|
||||
})
|
||||
);
|
||||
app.use(
|
||||
"/api",
|
||||
api({
|
||||
config,
|
||||
controller
|
||||
})
|
||||
);
|
||||
|
||||
app.server.listen(process.env.PORT || config.port, () => {
|
||||
console.log(`Started on port ${app.server.address().port}`);
|
||||
});
|
||||
});
|
||||
|
||||
export default app;
|
||||
Reference in New Issue
Block a user