-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (23 loc) · 692 Bytes
/
index.js
File metadata and controls
32 lines (23 loc) · 692 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
25
26
27
28
29
30
31
32
const express = require('express');
const { resolve } = require('path');
const app = express();
const port = 3010;
app.use(express.static('static'));
// Load the dotenv package
require('dotenv').config();
// Access environment variables
const config = {
apiKey: process.env.API_KEY,
serverSecret: process.env.SERVER_SECRET,
isKalvian: process.env.IS_KALVIAN === 'true',
};
// Export the config object
module.exports = config;
// Log the variables (Optional for testing)
console.log(config);
app.get('/', (req, res) => {
res.sendFile(resolve(__dirname, 'pages/index.html'));
});
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`);
});