24 lines
713 B
JavaScript
24 lines
713 B
JavaScript
|
|
import 'dotenv/config';
|
||
|
|
import express from 'express';
|
||
|
|
import cookieParser from 'cookie-parser';
|
||
|
|
import hostAuth from './routes/hostAuth.js';
|
||
|
|
import hostPlaylists from './routes/hostPlaylists.js';
|
||
|
|
import publicPlaylist from './routes/publicPlaylist.js';
|
||
|
|
import session from './routes/session.js';
|
||
|
|
|
||
|
|
const app = express();
|
||
|
|
app.use(cookieParser());
|
||
|
|
app.use(express.json());
|
||
|
|
|
||
|
|
app.get('/api/health', (req, res) => res.json({ ok: true }));
|
||
|
|
|
||
|
|
app.use('/api/spotify', hostAuth);
|
||
|
|
app.use('/api/host', hostPlaylists);
|
||
|
|
app.use('/api/public-playlist', publicPlaylist);
|
||
|
|
app.use('/api/session', session);
|
||
|
|
|
||
|
|
const PORT = process.env.PORT || 3010;
|
||
|
|
app.listen(PORT, () => {
|
||
|
|
console.log(`fullhouse API listening on :${PORT}`);
|
||
|
|
});
|