Questions tagged [opa]

Opa is an open source programming language for both backend and frontend web development. Opa therefore provides a unified syntax and semantics for writing all aspects of a web application: client-side, server-side and database queries. But it’s not only about expressiveness: Opa also features a unique type system that provides strong static typing from the client UI to the MongoDB queries.

Important links:

251 questions
3
votes
1 answer

OPA syntax question

I have seen in the stdlib and in some github project. Code like that : MyClass = field_id(id) = "{id}_field" {{ my_func(args) = output }} What the interest to have function before the {{ }} block ??
Mattgu74
  • 224
  • 1
  • 6
3
votes
1 answer

Opa: Nodejs not found

I get the following message while trying to ./configure opa_v2980 using Cygwin in Windows XP 32-bit: Checking for nodejs... Not found I've already successfully installed nodejs in Cygwin using the following steps outlined by Schalk…
Anthony
  • 3,990
  • 23
  • 68
  • 94
3
votes
1 answer

How to parse XML with Opa?

if you want to connect an Opa web client with a XML-RPC server. The right way to send a request is probably xml request_body = @xml( my_rpc_method some_rpc_params
JHannes
  • 1,456
  • 2
  • 10
  • 12
3
votes
1 answer

opa: google analytics

I'd like to add a tracker for google analytics in my opa application. I need to put the script provided by google just before the closing of my html code. How can I do that ?
Guillaume
  • 289
  • 1
  • 7
3
votes
1 answer

Opa match pattern OR

I am writing my first Opa application. I am trying to set up a match for url handling. Code is as follows: function start(url) { match (url) { case {path:[] ...}: Resource.page("Home", home()) case {...}:…
arcologies
  • 742
  • 1
  • 6
  • 22
2
votes
2 answers

OPA: command line parameters documentation

I was just looking for a way to tell the OPA http server what port to listen I found this article http://blog.opalang.org/2011/06/first-steps-hello-web-in-opa.html that talks about the --port parameter I'd like to know where are all these parameters…
opensas
  • 60,462
  • 79
  • 252
  • 386
2
votes
1 answer

Connecting OPA to existing relational databases

Is there any way to connect OPA to existing data in relational databases (e.g. oracle or sql server)? Thanks
seven3010
  • 23
  • 2
2
votes
1 answer

Does Opa provide algebraic datatypes?

I am trying to get a deeper understanding of the concepts behind Opa. In particular, I'm curious about the decision not to provide discriminated unions like in ML or Haskell (i.e. to define several constructors which wrap zero or more values), but…
Milo
  • 431
  • 2
  • 4
2
votes
1 answer

parsing a webclient.Result content in OPA

I am trying to use the webclient module to query the couchDB rest interface (I am using it instead of the opa couchdb api because I need to get a specific number of documents). Here is the code used to make the query: listmydocs(dburi)= match …
jeant
  • 23
  • 3
2
votes
1 answer

Opa: Deploy properly opa application

What is the clean way to deploy an opa application ? Can it be mixed with an apache server, to redirect specific pages to the opa application ? Thanks
user984846
  • 263
  • 2
  • 8
2
votes
2 answers

Multiple Opa Web Apps On One Server

I currently have multiple websites set up with the standard Apache virtual host configuration. My question is how do I set up multiple websites built using Opa so that they run like they would with to with Apache virtual hosts. ex. When a user types…
2
votes
2 answers

opa: can't compile hello chat demo (another error)

I know that there's another post about this but, I've a different error than Opa won't compile hello_web.opa. When trying to compile the hello_chat.opa sample 3. Hello, chat, I get the following error: In hello_chat.opa [1:29-1:29 | global…
gsscoder
  • 3,088
  • 4
  • 33
  • 49
2
votes
2 answers

How to execute a shell command in Opa?

I couldn't find in the API anything that would allow me to execute a shell command, something on the line of what system or exec do. Is using the Foreign Function Interface the only way to achieve this at the moment?
Pedro Rodrigues
  • 1,732
  • 11
  • 17
2
votes
1 answer

How to create a stringmap

When I try to compile an Opa program with m: stringmap(list(string)) = StringMap.empty() I get this error: Function was found of type ordered_map(string, 'a, String.order) but application expects it to be of type -> 'b. I'd appreciate any…
BahmanM
  • 1,420
  • 10
  • 18
2
votes
1 answer

OPA giving error "rego_parse_error: var cannot be used for rule name"

I have a simple rego file like this: package example default isApplicable := false isApplicable if { timeNow := time.now_ns() timeNow >= input.startDatetime } and I keep getting parse error: "rego_parse_error: var cannot be used for rule…
rsc
  • 10,348
  • 5
  • 39
  • 36
1 2
3
16 17