Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tyelf22 committed Jan 22, 2020
0 parents commit dfad664
Show file tree
Hide file tree
Showing 6 changed files with 1,279 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
22 changes: 22 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const express = require('express')
const app = express()
const bodyParser = require('body-parser')
const path = require('path')

app.use(bodyParser.urlencoded({extended: false}))

app.use(express.static(path.join(__dirname, 'public')))

app.get("/api", (req, res, next) => {
res.json({
this: "is my server",
listening: "on port 5000",
for: "my nodeJs server assignment"
})
})

app.get("/", (req, res, next) => {
res.sendFile(path.join(__dirname, "./", "routes", "welcome.html"))
})

app.listen(5000)
Loading

0 comments on commit dfad664

Please sign in to comment.