Skip to content
Snippets Groups Projects
Commit 172bae1c authored by Arto's avatar Arto
Browse files

Korjaus gitille ja upgrade

parent 0e4e004a
Branches master
No related tags found
No related merge requests found
File moved
const express = require('express')
const app = express()
const bodyParser = require('body-parser')
app.use(bodyParser.json())
const cors = require('cors')
app.use(cors())
app.use(bodyParser.json())
const logger = (request, response, next) => {
console.log('Method:',request.method)
console.log('Path: ', request.path)
console.log('Body: ', request.body)
console.log('---')
next()
}
app.use(logger)
let persons = [
{
......
{
"_from": "cors",
"_from": "cors@^2.8.5",
"_id": "cors@2.8.5",
"_inBundle": false,
"_integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
"_location": "/cors",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"type": "range",
"registry": true,
"raw": "cors",
"raw": "cors@^2.8.5",
"name": "cors",
"escapedName": "cors",
"rawSpec": "",
"rawSpec": "^2.8.5",
"saveSpec": null,
"fetchSpec": "latest"
"fetchSpec": "^2.8.5"
},
"_requiredBy": [
"#USER",
......@@ -22,7 +22,7 @@
],
"_resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
"_shasum": "eac11da51592dd86b9f06f6e7ac293b3df875d29",
"_spec": "cors",
"_spec": "cors@^2.8.5",
"_where": "C:\\Users\\arto\\documents\\part3exercises",
"author": {
"name": "Troy Goode",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment