Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 22 2018 12:49
    per-samuelsson labeled #4643
  • May 22 2018 12:48
    per-samuelsson labeled #4643
  • May 22 2018 12:48
    per-samuelsson opened #4643
  • May 22 2018 12:43
    miyconst commented #4642
  • May 22 2018 12:42
    miyconst assigned #4642
  • May 22 2018 12:39
    per-samuelsson commented #4642
  • May 22 2018 12:34
    miyconst labeled #4642
  • May 22 2018 12:34
    miyconst commented #4642
  • May 22 2018 12:33
    miyconst labeled #4642
  • May 22 2018 12:21
    bigwad commented #4638
  • May 22 2018 12:21
    per-samuelsson edited #4642
  • May 22 2018 12:21
    per-samuelsson commented #4642
  • May 22 2018 12:21
    per-samuelsson labeled #4642
  • May 22 2018 12:21
    per-samuelsson labeled #4642
  • May 22 2018 12:20
    per-samuelsson opened #4642
  • May 22 2018 12:02
    per-samuelsson commented #4638
  • May 22 2018 10:45
    k-rus commented #4641
  • May 22 2018 10:19

    bigwad on 121

    (compare)

  • May 22 2018 10:19

    bigwad on develop

    Add blocking debugger notificat… (compare)

  • May 22 2018 10:03

    bigwad on 121

    Add blocking debugger notificat… (compare)

pal88
@pal88

using System;
using Starcounter;

namespace example4
{
class Hello
{
static void Main()
{
Handle.GET("/squared?{?}", (int x) =>
{
return "<!DOCTYPE html><title>Hello</title>" + x + " squared equals " + x * x;
});
}
}

}

it runs now but gives error" URI not found: GET /example4 "
when tried to open it in a browser...
Per Samuelsson
@per-samuelsson
" GET /example4" is the wrong string, you should to "localhost:8080/squared" to invoke it
pal88
@pal88
tried that as well still says the same thing...:(
it says resource not found..
Per Samuelsson
@per-samuelsson
maybe you are not formatting it correctly? are you providing a number to be squared for example?
pal88
@pal88
should not the number be given at run time
Per Samuelsson
@per-samuelsson
localhost:8080/squared?10
yes, it should, its a parameter in the call to your handler
pal88
@pal88
oh i dint know that....thanks..
Per Samuelsson
@per-samuelsson
if u define your handler like u have done in the code above, you should invoke it (from a browser for example, or using curl) like this: localhost:8080/squared?100
pal88
@pal88
im sorry may be i dint understand the tutorial properly....it should have been beginner friendly...
thanks for your patience... @per-samuelsson
Per Samuelsson
@per-samuelsson
sure, no problem! we are here to help :hand:
pal88
@pal88
is there any tutorial on how to plot a graph using starcounter??
Per Samuelsson
@per-samuelsson
hi pal88
no, not to my knowledge
maybe @dan31 knows?
pal88
@pal88
is there any tutorial on how to plot a graph using starcounter??
Per Samuelsson
@per-samuelsson
hi again pal88
this is out of my expertice, sorry
can write a few lines about what is is you are after, and I will try to redirect your questions to someone that might know better?
pal88
@pal88
oh.. can someone help me out... thanks..
Per Samuelsson
@per-samuelsson
yes, if u specify more precisely what u are after
pal88
@pal88
hi @per-samuelsson
i need to plot graphs using data acquired on a regular basis...
for eg - like plotting a graph of temperature variations over a week/month
Per Samuelsson
@per-samuelsson
ok
i will forward this and see if someone can help u out
Marcin Warpechowski
@warpech
from the server side, you need to expose the data as a JSON array
and then on the client, you just bind to the data, preferably using a Web Component or some JavaScript charting library
Ivar Bergman
@ivarbergman
Hi! What is the recommended way to get the Location value (in Javascript)? I need to create a xhr call to a Handle, and thus need to set the Referer headers. Is there some method/property on the Puppet object I can use to fetch the Location value?
Ivar Bergman
@ivarbergman
I think I found it. Can you confirm that this seems like a OK way to pass the session/location in a xhr call:
xhr.setRequestHeader('X-Referer', puppet.network.remoteUrl.pathname); 
Per Samuelsson
@per-samuelsson
hi @ivarbergman
sorry, this is totally not my area, I'll see if I can find someone that can pop in and comment on your findings :sparkles:
Tomek Wytrębowicz
@tomalec
Hi @ivarbergman , do you really need to make very custom XHR? there is a puppet.network.send method
Per Samuelsson
@per-samuelsson
thanks tomalec :+1:
Tomek Wytrębowicz
@tomalec
.send will take care on versioning, OT and all that stuff for you
in other case puppet.network.remoteUrl seems good way to go, but we have not tested it that way, and probably you will need to handle versioning manually
Ivar Bergman
@ivarbergman
Thanks! I will take a look at .send
Tomek Wytrębowicz
@tomalec
You can let me know directly if you find any problems with it
Marcin Warpechowski
@warpech
@ivarbergman is some pattern regarding the use of Puppet that we could further explain in the docs?
Ivar Bergman
@ivarbergman

Thanks for the feedback. Maybe I should explain what I am trying to do. (You might have a better suggestion on how to implement this):

We use html5 FileApi to upload large files to the server. Each file is divided into chunks. The client makes a http get request to check if the chunk already exists on the server. I the chunk needs to uploaded the client makes a http post call with the file chunk data. This is repeated until all chunks exists on the server.

We also thinking about wrapping the http://www.resumablejs.com/ into a web component with a starcounter handler backend.

Therefore I need to make a custom xhr call, to be able act on different http status, but I still need to make sure that the Session is intact. Have you done anything similar to this?

Ivar Bergman
@ivarbergman

Hi! Is there a way to get the current instance of the ServerConfiguration class? From within an application.

The reson is that I need to get the DatabaseDirectory property to perform a backup routine using ShadowSpawn as described in the Guide

Ivar Bergman
@ivarbergman
(One could argue that it is easier to make a bat-script with the path hard coded. But since the path is in the database config file it might be less administrative hassle to trigger the backup job from the application it self.)
Marcin Warpechowski
@warpech
since Administator deals a lot with reading server config, maybe you will find a way browsing the Administrator source? https://github.com/Starcounter/Starcounter/tree/develop/src/Starcounter.Administrator
Sufian Saory
@thesufian
This message was deleted
This message was deleted