mirror of
https://github.com/pawelmalak/snippet-box.git
synced 2025-12-21 21:33:10 +01:00
Database changes. Added Snippet model and controller
This commit is contained in:
@@ -3,16 +3,22 @@ import express from 'express';
|
||||
import { Logger } from './utils';
|
||||
import { connectDB } from './db';
|
||||
|
||||
// Routers
|
||||
import { snippetRouter } from './routes/snippets';
|
||||
|
||||
// Env config
|
||||
dotenv.config({ path: './src/config/.env' });
|
||||
|
||||
const app = express();
|
||||
const logger = new Logger();
|
||||
const logger = new Logger('server');
|
||||
const PORT = process.env.PORT;
|
||||
|
||||
// App config
|
||||
app.use(express.json());
|
||||
|
||||
// Routes
|
||||
app.use('/api/snippets', snippetRouter);
|
||||
|
||||
(async () => {
|
||||
await connectDB();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user