Skip to content

Commit

Permalink
chore: update downstream libraries for provider state injected values…
Browse files Browse the repository at this point in the history
… support #516
  • Loading branch information
Ronald Holshausen committed Nov 17, 2020
1 parent 5fdf7eb commit fd6e99b
Show file tree
Hide file tree
Showing 5 changed files with 266 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ const accountRepository = {
account.version = version
account.accountNumber.id = accountNumber
accounts.push(account)
console.log("save", accounts)
return account
},

findByAccountNumber: async (accountNumber) => {
console.log("find", accountNumber, accounts)
return accounts.find(account => account.accountNumber.id == accountNumber)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ const { Account, AccountNumber, accountRepository } = require("./account-reposit
const express = require("express")
const cors = require("cors")
const bodyParser = require("body-parser")
const url = require("url")

const server = express()
server.use(cors())
server.use(bodyParser.json())

server.get("/accounts/search/findOneByAccountNumberId", (req, res) => {
return accountRepository.findByAccountNumber(req.query.accountNumber).then(account => {
console.log("account = ", account)
if (account) {
res.header("Content-Type", "application/hal+json; charset=utf-8")
let baseUrl = req.protocol + "://" + req.hostname + ":" + req.socket.localPort
Expand All @@ -33,7 +31,6 @@ server.get("/accounts/search/findOneByAccountNumberId", (req, res) => {
name: account.name,
version: account.version
}
console.log(body)
res.json(body)
} else {
res.status(404).end()
Expand Down
Loading

0 comments on commit fd6e99b

Please sign in to comment.