Skip to content

Commit

Permalink
fix: Gah! Lint Nazis
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen committed Sep 28, 2019
1 parent 7683ba8 commit 79082fd
Show file tree
Hide file tree
Showing 4 changed files with 410 additions and 43 deletions.
4 changes: 2 additions & 2 deletions examples/v3/todo-consumer/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const express = require('express')
const express = require("express")
const app = express()
const port = 3000

app.get('/', (req, res) => res.send('Hello World!'))
app.get("/", (req, res) => res.send("Hello World!"))

app.listen(port, () => console.log(`Example app listening on port ${port}!`))
51 changes: 26 additions & 25 deletions examples/v3/todo-consumer/src/todo.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
const axios = require('axios')
const parser = require('xml2json')
const eyes = require('eyes')
const axios = require("axios")
const parser = require("xml2json")
const eyes = require("eyes")

let serverUrl = 'http://localhost:2203'
let serverUrl = "http://localhost:2203"

module.exports = {
getProjects: async (format = "json") => {
return axios.get(serverUrl + '/projects?from=today', {
headers: {
'Accept': 'application/' + format
}
})
.then(response => {
console.log("todo response:")
eyes.inspect(response.data)
if (format === 'xml') {
const result = JSON.parse(parser.toJson(response.data))
return result.projects.project
} else {
return response.data
}
})
.catch(error => {
console.log("todo error", error.message)
return Promise.reject(error)
})
return axios
.get(serverUrl + "/projects?from=today", {
headers: {
Accept: "application/" + format,
},
})
.then(response => {
console.log("todo response:")
eyes.inspect(response.data)
if (format === "xml") {
const result = JSON.parse(parser.toJson(response.data))
return result.projects.project
} else {
return response.data
}
})
.catch(error => {
console.log("todo error", error.message)
return Promise.reject(error)
})
},
setUrl: function (url) {
setUrl: function(url) {
serverUrl = url
return this
}
},
}
Loading

0 comments on commit 79082fd

Please sign in to comment.