Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

LiHan
LiHan

Posted on

     

[ktor] Generate Ktor Project - Part 1

Ktor Project Link And Setting

https://start.ktor.io/

setting-1

setting-2

Download Project And Start it !

setting-3-start

Put Food Images

Image description

Create Model - Food

const val BASE_URL =  "http://127.0.0.1:8080/"data class Food(    val name : String,    val description : String ,    val imagePath : String){    companion object{        val foodList = listOf<Food>(            Food(                name = "PorkRice",                description = "basil minced pork with rice fried egg",                imagePath = "$BASE_URL/static/food/food1.jpg"            ),            Food(                name = "BBQ Chinese Food",                description = "bbq grill cooked with hot spicy sichuan pepper sauce is chinese herb",                imagePath = "$BASE_URL/static/food/food2.jpg"            ),            Food(                name = "French fries",                description = "crispy french fries with ketchup mayonnaise",                imagePath = "$BASE_URL/static/food/food3.jpg"            ),            Food(                name = "Vegetable",                description = "This is Vegetable",                imagePath = "$BASE_URL/static/food/food4.jpg"            ),            Food(                name = "Noodle",                description = "Great noodle !!",                imagePath = "$BASE_URL/static/food/food5.jpg"            ),        )    }}
Enter fullscreen modeExit fullscreen mode

Final Start Again To Test Image

example:
http://127.0.0.1:8080/static/food/food2.jpg

Get Food Image File From GitHub Plz

https://github.com/encorex32268/com.example.anyprojectnamehere

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I'm Android Developer
  • Work
    Android Developer
  • Joined

More fromLiHan

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp