mirror of
https://gitlab.com/sarlink/kyc.git
synced 2025-02-22 23:52:05 +00:00
22 lines
534 B
JavaScript
22 lines
534 B
JavaScript
require("dotenv").config()
|
|
|
|
const registrationOpen = process.env.REGISTRATION_OPEN === "true"
|
|
|
|
const express = require("express")
|
|
const app = express()
|
|
app.use(express.json())
|
|
app.use(express.urlencoded({ extended: true }))
|
|
|
|
// add multer
|
|
const multer = require("multer")
|
|
const upload = multer()
|
|
app.use(upload.single("receipt"))
|
|
|
|
app.get("/", (req, res) => {
|
|
res.render(registrationOpen ? "index" : "closed")
|
|
});
|
|
|
|
const port = process.env.PORT || 4818;
|
|
app.listen(port, () => {
|
|
console.log(`Server is running on port ${port}`);
|
|
}); |