Code cleanup

This commit is contained in:
Syed Mansoor 2018-05-21 22:22:07 +10:00
parent b1f6b024fc
commit ab566c6c84
1 changed files with 7 additions and 6 deletions

View File

@ -10,8 +10,7 @@ fun main(args: Array<String>) {
val app = express()
app.get("/crypto", { _, res ->
println(generateCryptoRates())
res.send(generateCryptoRates())
res.send(generateCryptoRates())
})
app.listen(3000, {
@ -19,8 +18,10 @@ fun main(args: Array<String>) {
})
}
fun generateCryptoRates(): Array<CryptoCurrency>{
val crytoCurrency = arrayOf<CryptoCurrency>(CryptoCurrency("Bitcoin",
90000F), CryptoCurrency("ETH",1000F),
CryptoCurrency("TRX",10F));
return crytoCurrency
val cryptoCurrency = arrayOf<CryptoCurrency>(
CryptoCurrency("Bitcoin", 90000F),
CryptoCurrency("ETH",1000F),
CryptoCurrency("TRX",10F)
);
return cryptoCurrency
}