Last active
September 21, 2020 03:14
-
-
Save jinwook-k/26d68f34caab3aa97747c0eaf666a68b to your computer and use it in GitHub Desktop.
server/server.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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