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