ddstats-server/index.js

22 lines
485 B
JavaScript
Raw Normal View History

2021-09-25 12:11:27 +02:00
import express from 'express'
2021-09-25 17:47:05 +02:00
import dotenv from 'dotenv'
2021-09-26 18:06:45 +02:00
import sqlite2mongo from './libs/sqlite2mongo.js'
2021-09-25 17:47:05 +02:00
// Read the .env file
dotenv.config()
2021-09-25 12:11:27 +02:00
const Server = express()
Server.get('/', (req, res) =>
res.status(200)
.json(
{
status: "OK!",
message: "The API is up and running! The current version is: 0.0.1"
}
)
)
2021-09-26 18:06:45 +02:00
sqlite2mongo()
2021-09-25 17:47:05 +02:00
2021-09-26 18:06:45 +02:00
Server.listen(process.env.PORT, () => console.log("Server has started!"))