Questions tagged [finatra]

A Sinatra (software)-inspired web framework for scala, running on top of Finagle, from Twitter.

Finatra is a framework for fast, testable Scala services that is built on TwitterServer and Finagle

It is used in production by Twitter.

Reference: Finatra

44 questions
1
vote
3 answers

how to load assets,such as .css, .js file, in finatra?

I try return a html file by finatra, the file itself loaded success but all assets can't, contains css, ico and js. Browser response 404:can't load resources. find the document at bottom of the page: -com.twitter.finatra.config.assetPath='/public':…
LoranceChen
  • 2,453
  • 2
  • 22
  • 48
1
vote
1 answer

Scala: How to include a JS script to Mustache template in Finatra?

I'm trying to include a JS script within my mustache template file.
Users:
    {{#users}}
  • {{name}}
Finkelson
  • 2,921
  • 4
  • 31
  • 49
1
vote
1 answer

Finatra - how to add url encoder

I have a finatra server, in the response string there are currency symbols. which looks fine in the server but in the browser I get £5.25 instead of £5.25 any advice on how to fix this issue? recommended url encoder? thanks, Dana
Dana Klein
  • 159
  • 1
  • 12
1
vote
1 answer

Finatra - reading a request in chunks

Here's my use case: I am implementing a finatra server, that should be able to receive many concurrent large requests. These requests have a large body (several megabytes) comprised of many small json objects, concatenated. I'd like to avoid loading…
Amir Tuval
  • 317
  • 1
  • 7
0
votes
1 answer

how to set response with camelCase in finatra

I need to return a json response in camelCase with finatra but it is in snake_case by default. From what I found so far, I need to use ObjectMapper, but I can't understand where do I pass it once I create it. An example would be very helpful. Here…
chibis
  • 658
  • 2
  • 12
  • 22
0
votes
2 answers

Set Finatra HTTP request timeout

Is it possible to set HTTP request-response timeout in a Finatra server? The http controller callback typically returns a Future, that once resolved the response is transmitted. I would like to define, within Finatra, how long the server should…
yannisf
  • 6,016
  • 9
  • 39
  • 61
0
votes
2 answers

Using Finatra with SBT, where are the files searched for?

Where does Finatra search for the files? When I write response.ok.file(...) in which folder should the files be placed to be found? In the docs it says the "classpath root" which is nowhere to be found (as it doesn't exist, strictly speaking).
LowFieldTheory
  • 1,722
  • 1
  • 26
  • 39
0
votes
1 answer

modify Finatra response header

Finatra returns framework's name by default in response header as "Server" -> Finatra, for some reason, I don't want to expose this part of information. Is there anyway to modify it? I have tried filters and response.ok.header.set. but no…
0
votes
1 answer

Mongo Number of Connections is Negative (Connections Don't Properly Terminate)

I have a service that connects to a Mongo Cluster running on MongoAtlas. The test suite, for the time being, connects to the cluster runs a number of tests, destroys the created data and closes the connection, at least thats what it is supposed to…
sinanspd
  • 2,589
  • 3
  • 19
  • 37
0
votes
1 answer

Trouble using case class for multiple fields in POST body Finatra

I am working on a simple Finatra API example, but having trouble using a case class for the POST request when using more than one field in the request body. Here is an example of my case class and controller: class SaleResource extends Controller { …
foobarbaz
  • 508
  • 1
  • 10
  • 27
0
votes
0 answers

Converting Guava futures to Twitter ones

I have a Finatra application that accesses Cassandra using Datastax driver which produces Guava Futures. The conversion is done by following code import com.google.common.util.concurrent.{FutureCallback, Futures, ListenableFuture} import…
synapse
  • 5,588
  • 6
  • 35
  • 65
0
votes
1 answer

Finatra TooLongMessageException HTTP content length exceeded 5242880 bytes, despite flag setting more bytes

I'm seeing a TooLongMessageException HTTP content length exceeded 5242880 bytes. exception thrown from my finatra server. Looking at the flags available via -help=true, it looks like the flag to set is maxRequestSize. Here is the output of the help…
Clayton
  • 325
  • 5
  • 12
0
votes
1 answer

Finatra IntegrationTest failed with "object TwitterModule is not a member of package com.twitter.inject"

I got a problem when implementing IntegrationTest with Finatra on Scala. I'm just following their official docs for early implementation, but I got error [error] D:\Workspace\OpenSource\kanca-api\src\test\scala\io\kanca\GraphTestModule.scala:4:8:…
Andi N. Dirgantara
  • 2,050
  • 13
  • 20
0
votes
0 answers

Guice: Could not find a suitable constructor in com.twitter.inject.Injector

I am using Guice injections and Finatra with my service. When trying to build a small test app I am getting this error: Could not find a suitable constructor in com.twitter.inject.Injector. Classes must have either one (and only one) constructor…
Visiedo
  • 377
  • 5
  • 9
0
votes
1 answer

HTTP to HTTPS redirection on Google Compute Engine with Finatra Server

I am trying to redirect http connections to https connections on our server. Here's my setup for now: I have 2 Global Forwarding rules as follows: Rule 1 redirects all https connections to my instance as https://app.example.com Rule 2 redirects…