https://github.com/kaushalvasava/demorestapi
It is a Rest Api using Kotlin, Docker.
https://github.com/kaushalvasava/demorestapi
backend-api docker gradle kotlin kotlin-backend kotlin-multiplatform rest-api restapi serialization server
Last synced: 3 months ago
JSON representation
It is a Rest Api using Kotlin, Docker.
- Host: GitHub
- URL: https://github.com/kaushalvasava/demorestapi
- Owner: KaushalVasava
- Created: 2023-07-26T07:50:35.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-30T12:48:40.000Z (almost 2 years ago)
- Last Synced: 2025-02-06T12:48:05.637Z (5 months ago)
- Topics: backend-api, docker, gradle, kotlin, kotlin-backend, kotlin-multiplatform, rest-api, restapi, serialization, server
- Language: Kotlin
- Homepage:
- Size: 74.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
It is a simple REST Api using Kotlin and Docker.
# Setup
- Download kobweb
https://github.com/varabyte/kobweb-cli/releases/download/v0.9.13/kobweb-0.9.13.zip
- Set `path variable` of kobweb. ie. ..kobweb/bin folder path
- Open Command prompt, set your project directory location and Run `kobweb create`
- Open IntelliJ IDE and open kobweb project from your project location
- Build project and If getting error then open `settings.gradle.kts` and change root project name to `Pascal Case` ie. DemoApi then re-build.# Steps
- Write your code in `/api` package
- If you need serializaton plugin then checkout this repo https://github.com/Kotlin/kotlinx.serialization and put in the `libs.version.toml` file and use in your `build.gradle.kts`.
- To Run server
1. Goto terminal in the IntelliJ
2. Write `cd site`
4. Write `kobweb run`
If you get nodejs error then download it from the error link. ie. 'https://nodejs.org/dist/v18.12.1/node-v18.12.1-win-x64.zip'.5. Open browser and run localserver, ie. http://localhost:8080/api/people?count=2
6. Push code on Github# Deploy server for free
- Goto https://render.com/
- Create account
- Connect your github
- Create new webservice from render dashboard
- Select your github repo and connect
- Give name and choose free plan
- Click on Create webservice, It will take few minutes to deploy, so be patience
- After successfully deploy, you can check your API from given link.# Technology & Tools Used
- Kotlin
- Docker
- Gradle
- IntelliJ IDEReference https://youtu.be/o7OXfMRSIH4
Author: Kaushal Vasava