forked from valeri879/api.val-do.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
24 lines (20 loc) · 664 Bytes
/
index.js
File metadata and controls
24 lines (20 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require("dotenv").config();
const express = require("express");
const app = express();
require("./start/routes.start")(app);
require("./start/db.start")();
// file converter
/* const fs = require('fs');
const sharp = require('sharp');
fs.readdirSync('uploads').forEach(file => {
// console.log(file)
const imgRegex = /\.(jpg|png|jpeg)\b/i;
if (imgRegex.test(file)) {
sharp(`./uploads/${file}`).resize({ width: 320 }).toFile(`./uploads/small/${file}`).then(() => { });
}
}) */
if (!process.env.PRIVATE_KEY) {
process.exit(1);
}
const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`Listening on port ${port}...`));