Skip to content

Commit

Permalink
refactor : Base Url 숨김 #7
Browse files Browse the repository at this point in the history
  • Loading branch information
SeonHwan-Kim committed May 8, 2023
1 parent fd82bcf commit 93632bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ plugins {
id 'org.jetbrains.kotlin.plugin.serialization' version '1.7.21'
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

android {
namespace 'org.android.go.sopt'
compileSdk 33
Expand All @@ -21,6 +24,9 @@ android {
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

// BASE URL 불러오기
buildConfigField "String", "BASE_URL", properties['BASE_URL']
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package org.android.go.sopt.data.remote
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
import kotlinx.serialization.json.Json
import okhttp3.MediaType.Companion.toMediaType
import org.android.go.sopt.BuildConfig
import org.android.go.sopt.data.remote.service.SignInService
import org.android.go.sopt.data.remote.service.SignUpService
import retrofit2.Retrofit

object ApiFactory {
val retrofit: Retrofit by lazy{
Retrofit.Builder()
.baseUrl("http://52.78.152.187:8080/")
.baseUrl(BuildConfig.BASE_URL)
.addConverterFactory(Json.asConverterFactory("application/json".toMediaType()))
.build()
}
Expand Down

0 comments on commit 93632bf

Please sign in to comment.