mirror of
https://github.com/20kaushik02/spotify-manager.git
synced 2026-01-25 14:14:06 +00:00
setting up stuff
This commit is contained in:
28
index.js
Normal file
28
index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
require('dotenv').config();
|
||||
const express = require('express');
|
||||
const cors = require('cors');
|
||||
const cookieParser = require('cookie-parser');
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(cors());
|
||||
app.use(cookieParser());
|
||||
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
|
||||
app.use(express.static(__dirname + '/public'));
|
||||
|
||||
app.use("/api/auth/", require("./routes/auth"));
|
||||
|
||||
app.use((_req, res) => {
|
||||
return res.status(404).send(
|
||||
"Oops! You're not supposed to know about <a href=\"https://github.com/20kaushik02/spotify-manager\">this</a>..."
|
||||
);
|
||||
})
|
||||
|
||||
const port = process.env.PORT || 3000;
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`App Listening on port ${port}`);
|
||||
});
|
||||
Reference in New Issue
Block a user