Skip to content

Instantly share code, notes, and snippets.

@jinwook-k
Last active September 21, 2020 03:14
Show Gist options
  • Save jinwook-k/26d68f34caab3aa97747c0eaf666a68b to your computer and use it in GitHub Desktop.
Save jinwook-k/26d68f34caab3aa97747c0eaf666a68b to your computer and use it in GitHub Desktop.
server/server.js
require('dotenv').config();
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const port = process.env.PORT || 5000;
// use body parser to get data from POST requests
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
// Use API routes from the api folder
const apis = require("./api");
app.use("/api", apis);
app.listen(port, () => console.log(`Listening on port ${port}`));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment