Skip to content

ran express, added start script #292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Server Side Routing Module Project
# Server Side Routing Module Project

## Introduction

Expand Down
15 changes: 15 additions & 0 deletions api/server.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
// implement your server here
// require your posts router and connect it here
const express = require('express')

const server = express()

// MIDDLEWARE
server.use(express.json())

server.use('*', (req,res)=>{
res.status(404).json({
message: 'not found'
})
})

// EXPORTS
module.exports = server
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
// require your server and launch it here
// console.log("Whats up buttercup!")
const server = require("./api/server")

const PORT = 5000

server.listen(PORT, ()=>{
console.log('listening on ', PORT)
})


7 changes: 5 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.1",
"main": "index.js",
"scripts": {
"start": "node index.js",
"server": "nodemon index.js",
"test": "cross-env NODE_ENV=testing jest --verbose --runInBand --silent",
"resetdb": "knex migrate:rollback && knex migrate:latest && knex seed:run"
Expand Down