Ролан
07/18/2021, 3:21 PMMustafa Ozhan
07/20/2021, 10:26 AM./gradlew :backend:run
everything works as expected I can reach it by <http://127.0.0.1:8080/endpoint>
it reposes.
I have created a fat jar and run in my server but I can not get response when i <http://IP_ADRESS:8080/endpoint>
the main is below
// Configs
private const val PORT = 8080
private const val HOST = "127.0.0.1"
fun main() {
....
embeddedServer(
Netty,
port = PORT,
host = HOST
) {
routing {
....
}
}.start(wait = true)
}
What can be the reason, I have allowed my port alsogzhenjin
07/22/2021, 9:15 AMAlexander Suraphel
07/27/2021, 2:00 PMVenetia
08/02/2021, 11:42 PMVenetia
08/03/2021, 6:58 AMVitaliy Zarubin
08/03/2021, 8:13 AMBaidyanath
08/04/2021, 6:14 PMjmfayard
08/05/2021, 10:35 AMjean
08/06/2021, 7:24 AMString.escapeIfNeeded
method, is it enough to protect my database from injection and other possible attacks? I also found apache commons-text
library that has StringEscapeUtils
but it seems a bit less practical since there’s an escape method for java, one for ecmascript, etc…ESchouten
08/06/2021, 4:24 PMJoão Pedro De Melo Garrido
08/06/2021, 5:23 PMinstall(CORS) {
method(HttpMethod.Get)
method(<http://HttpMethod.Post|HttpMethod.Post>)
method(HttpMethod.Put)
method(HttpMethod.Delete)
method(HttpMethod.Head)
method(HttpMethod.Options)
header(HttpHeaders.AccessControlAllowHeaders)
header(HttpHeaders.AccessControlAllowOrigin)
header(HttpHeaders.Authorization)
allowCredentials = true
allowSameOrigin = true
anyHost()
}
this is my cors and when i add this line works (obvs cause it accepts text/plain) but dont understand whats happening
allowNonSimpleContentTypes = true
Christian
08/07/2021, 9:36 AMUser: {name: "potter", street: "hogwards-street", type: "cleaner"}
I publish these to my message broker and consumed it in an another service (B). Now the service (B) only needs {name: String, type: String}
. Should I still share the full model of User
as interface between the services or are these other types of User
models?Solomon Tolu Samuel
08/07/2021, 8:43 PMFROM openjdk:13 AS builder
RUN java --version
RUN mkdir /application
WORKDIR /application
COPY ./ ./
RUN ./gradlew clean build
RUN ls -al build/libs/
...
version: "3"
services:
myapp:
build: .
And this is the error i keep getting:
ERROR [6/7] RUN ./gradlew clean build 1.9s
------
> [6/7] RUN ./gradlew clean build:
#10 1.339 /bin/sh: ./gradlew: No such file or directory
------
executor failed running [/bin/sh -c ./gradlew clean build]: exit code: 127
ERROR: Service 'myapp' failed to build : Build failed
After trying lots of solutions, i decided to use another approach:
FROM openjdk:8-jre-alpine
ENV APPLICATION_USER ktor
RUN adduser -D -g '' $APPLICATION_USER
RUN mkdir /app
RUN chown -R $APPLICATION_USER /app
USER $APPLICATION_USER
COPY ./build/libs/app.jar /app/app.jar
WORKDIR /app
CMD ["java","-server","-XX:+UnlockExperimentalVMOptions","-XX:+UseCGroupMemoryLimitForHeap","-XX:InitialRAMFraction=2","-XX:MinRAMFraction=2","-XX:MaxRAMFraction=2","-XX:+UseG1GC","-XX:MaxGCPauseMillis=100","-XX:+UseStringDeduplication","-jar","app.jar"]
And i also got a similar error:
ERROR [5/6] COPY ./build/libs/app.jar /app/app.jar 0.0s
------
> [5/6] COPY ./build/libs/app.jar /app/app.jar:
------
failed to compute cache key: "/build/libs/app.jar" not found: not found
joseph_ivie
08/09/2021, 3:20 PMyuko fuyutsuki
08/11/2021, 12:06 AMPablo Schmid
08/11/2021, 5:50 PMextend type Mutation {
userCreate(): UserCreatePayload
}
union UserCreatePayload = UserCreated | UserAlreadyExists
I have a MutationsResolver that handles the userCreate
mutation by calling a UserService
that is transactional.
When trying to create a user, if the user already exists, I'm throwing a UserAlreadyExist
Exception that is handled in the mutation resolver with a try/catch block and then mapped to the UserAlreadyExists type in graphql.
The problem is that as the UserService is transactional, whenever I throw the exception, the transaction is marked a rollbackOnly by spring (which is good) and then the graphql flow goes through the DefaultGraphQLErrorHandler that finally return an error to the end user.
I would like to have the exactly same behavior except for the graphql error handler returning a GraphqlError. Instead I want to return the UserAlreadyExists
type I defined in the graphql schema.
Is there anyway to do so? (I do not want to use sealed classes instead of exceptions in the service as the code gets dirty)
Thanks!Sergey Dikunov
08/11/2021, 7:57 PMYuval Dryer
08/15/2021, 4:04 PMZhelenskiy
08/18/2021, 11:45 PMLandry Norris
08/19/2021, 7:21 PMAndre Stefanov
08/21/2021, 11:49 PMIf you provide additional class properties that are not part of the path of the @Location, those parameters will be obtained from the GET's query string or POST parametersWhile this seems to work fine for non-optional query parameters, i can't find any documentation on how to make the query parameters optional. out of intuition i tried to make location data class parameters nullable but this does not seem to lead to expected behavior. I wanted to have these routes:
/user?page=1&count=10
/user/{id}
this was done with following code:
@Location("/user")
data class UserRoute(val page: Int?, val count: Int?) {
@Location("/{id}")
data class ById(val parent: UserRoute, val id: String)
}
but now performing a GET on /user
results in a 404 if i don't provide the query parameters and works perfectly for /user?page=1&count=10
is there any documentation i missed or maybe someone can give me a quick kick into the right direction? thank you in advance!Denis Ambatenne
08/23/2021, 2:13 PMMickey Donaghy
08/25/2021, 8:28 AMJob
is there a way to find out where it was stuck? I can pass a CancellationException
in, but what I really want is a traceback for where it was when it got cancelled.Samuel Osei Kwakye
08/25/2021, 9:33 AMNolan
08/26/2021, 3:37 PM===
, and all of my unit tests passed. However, once deployed, the filter function did not work as expected. I wrote an simple JVM app to see if it was an issue with JVM specifically, but in that case "str" === "str"
resolved to true, which is not the behavior I was seeing in my Spring Boot app. Any ideas why I'd be seeing this discrepancy in the Spring Boot app?Baidyanath
08/29/2021, 2:56 PMJakub Neukirch
09/07/2021, 5:32 PMcall.request.origin.host
returns localhost
and after some reconfiguration of nginx it returns <http://backend.domain.com|backend.domain.com>
instead of <http://frontend.domain.com|frontend.domain.com>
. Setting up CORS for all endpoints with host("<http://frontend.domain.com|frontend.domain.com>")
works properly, allows only frontend domain, and blocks all otherMinsoo Cheong
09/09/2021, 1:34 AMSlackbot
09/09/2021, 11:34 AMSlackbot
09/09/2021, 11:34 AMAhsan Raza
09/09/2021, 12:23 PM