DEV Community

LiHan
LiHan

Posted on

1

[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 mode Exit 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

AWS Q Developer image

Your AI Code Assistant

Ask anything about your entire project, code and get answers and even architecture diagrams. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Start free in your IDE

Top comments (0)

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay