Questions tagged [afbedsheet]

BedSheet provides a rich middleware mechanism for routing and delivering content over HTTP; a Web Application Framework for the Fantom programming language.

BedSheet provides a rich middleware mechanism for routing and delivering content over HTTP.

Built on top of IoC and Wisp, BedSheet is inspired by Java's Tapestry5, Ruby's Sinatra and Fantom's Draft.

16 questions
4
votes
1 answer

Running afBedSheet sample produces "Service does not exist for Type 'afIocConfig::FactoryDefaults'" error

I'm trying to create a new web application in Fantom programming language using the afBedSheet framework but can't get the simplest example to run. The code is: using afBedSheet using afIoc class AppModule { @Contribute static Void…
LightDye
  • 1,174
  • 8
  • 14
2
votes
1 answer

How can I solve this dependency issue between Fantom pods afBedNap, afBounce and afBedSheet?

I found an issue trying to install afBedNap. The process went... fanr install -r http://repo.status302.com/fanr/ afBedNap afBedNap [upgrade ] 0.0.18 => 0.0.20 afBedSheet [downgrade] 1.4.2 => 1.3.16 ... Installation successful (2 pods) Then…
LightDye
  • 1,174
  • 8
  • 14
2
votes
1 answer

How do I route to a directory?

I'm playing around with afBedSheet and wish to handle all requests to a directory. eg a request to /abcd calls abcdMethod#doSomething I have the routes set up as @Contribute { serviceId="Routes" } static Void contributeRoutes(OrderedConfig conf) { …
2
votes
1 answer

How can a custom filter be added to the HttpPipeline using afBedSheet?

The afBedSheet documentation says that "Filters can be used to address cross cutting concerns such as authorisation." and shows this code snippet: @Contribute { serviceType=HttpPipeline# } static Void contributeHttpPipeline(OrderedConfig conf,…
LightDye
  • 1,174
  • 8
  • 14
1
vote
1 answer

How to enable Cross Origin Resource Sharing (CORS) in a Fantom / afBedSheet REST service?

I am developing a REST API with Fantom and afBedSheet. I need to allow cross-origin resource sharing so that I can call my RESTful services via AJAX from the UI which runs on a different web container on a different port. I am currently doing this…
LightDye
  • 1,174
  • 8
  • 14
1
vote
1 answer

How can I model GeoJSON geometries in Fantom?

I started with this basic abstract class for Geometry: @Serializable abstract const class Geometry { const Str type new make( Str type, |This| f ) { this.type = type f(this) } } Then I extended this abstract class to…
LightDye
  • 1,174
  • 8
  • 14
1
vote
1 answer

How to refer to a row index in a Fancordion fixture table?

Using tables in Fancordion v1.0.4, how can I use the row index in a column command to validate its value. For example if my Fixture is: class MyFixture : FixtureTest { [Str:Obj?][] getCountries() { return [["code":"AU",…
LightDye
  • 1,174
  • 8
  • 14
1
vote
1 answer

Why FancordionRunner suiteSetup is not being called?

I am following MyFancordionRunner example from Fancordion v1.0.4 official documentation to test a BedSheet application, but the suiteSetup method (see below) is not being called and the server remains null, causing the fixture tests to fail with a…
LightDye
  • 1,174
  • 8
  • 14
1
vote
1 answer

Custom FancordionRunner does not compile. What's wrong?

I am trying to compile a FancordionRunner modeled after MyFancordionRunner from the official Fancordion user guide, however, the compiler throws this error... /data/code/mypod/test/specs/WebFancordionRunner.fan(9,35): Invalid args make(), not…
LightDye
  • 1,174
  • 8
  • 14
1
vote
1 answer

what's the fanws cookie?

I wrote a simple site using BedSheet to test adding cookies. When I ran the code and inspected the cookies using firebug, I found a extra cookie I didn't add named fanws (with value 06e3d816-7626-7b00-205a-0013e8a56e9d-dbc9c6c8fa03cfa4). Here is my…
elyashiv
  • 3,503
  • 2
  • 26
  • 48
1
vote
1 answer

How to verify a RESTful service that returns a HTTP 404, using Fancordion?

I'm writing a RESTful API in Fantom programming language. I'm using Fancordion to write the acceptance tests and have this scenario: Country.fandoc Country by Code ############### Passing a country code as a parameter to the Country RESTful service…
LightDye
  • 1,174
  • 8
  • 14
1
vote
1 answer

What should be the lifecycle of afMongo's MongoClient?

Based on the afMongo example I'm currently doing this: mongoClient := MongoClient(ActorPool(), `mongodb://localhost:27017`) collection := mongoClient.db("mydb").collection("mycollection") ... // inserts or queries here ... mongoClient.shutdown My…
LightDye
  • 1,174
  • 8
  • 14
1
vote
1 answer

Why afBedSheet don't see my types?

I'm running a BedSheet application but when I make a HTTP request to a particular route, I get this error in the browser 500 - Internal Server Error afBeanUtils::TypeNotFoundErr - Could not find match for Type mypod::MyClass. Available…
LightDye
  • 1,174
  • 8
  • 14
1
vote
1 answer

Why afBedSheet application throws 'Service does not exist for Type afBedSheet::Routes'

Using the example from afBedSheet's documentation: using afIoc using afBedSheet class HelloPage { Text hello(Str name, Int iq := 666) { return Text.fromPlain("Hello! I'm $name and I have an IQ of $iq!") } } class AppModule { @Contribute…
LightDye
  • 1,174
  • 8
  • 14
1
vote
1 answer

ERROR: cannot init Sys.homeDir running a Fantom app based on afBedSheet on Mac OS X

Following the instructions from Alien Factory's afBedNap to build a web app using the afBedSheet framework for Fantom I got this error at the end of step 3 (running the app): $ fan myAfBedNap [09:37:54 03-Aug-14] [info] [afBedSheet] Starting…
LightDye
  • 1,174
  • 8
  • 14
1
2