I am building a application in Vapor. My website works fine on localhost but on the Heroku doesn't run correctly. I have got a list with elements from xml. Xml is parsing by SWXMLHash. Heroku printing only static header. I cant see any informations about error in server log. Everything need to works fine but not working.
guard let xmlString = response?.body.bytes?.string else {
throw Abort.custom(status: .badRequest, message: "Could not retrieve xml string")
}
let xml = SWXMLHash.parse(xmlString)
var cars:[Car] = []
for item in xml["findItemsByCategoryResponse"]["searchResult"]["item"].all {
cars.append(Car(item:item))
print("1 "+(item["title"].element?.text ?? ""))
}
var table:[Node]=[]
for car in cars {
table.append(try ["title": car.title,"url": car.auctionUrl,"price":car.price,"imgUrl":car.galeryUrl].makeNode())
}
var nodeTables = try table.makeNode()
return try drop.view.make("index", Node(node: ["cars": nodeTables]))