1. #11
    Sencha Premium Member natedsaint's Avatar
    Join Date
    Jul 2012
    Location
    Fort Worth, TX
    Posts
    21
    Vote Rating
    3
    natedsaint is on a distinguished road

      0  

    Default


    I got it all set up but it looks like this repo (SilkJS-extjs4) is a little out of date. I'm getting a ton of errors whenever I try to start it. Originally, I got this:

    Code:
    4766 configbuiltin/include.js:61: Could not compile config.js
    ReferenceError: Config is not defined
                            throw "Could not compile " + fn + "\n" + e.toString();
                                              ^
    no stack trace available
    So I noticed Config.mysql was being set immediately on line 10 of config.js, so I initialized it first, but then I got this:

    Code:
    4857 config
    /usr/local/silkjs/modules/Schema.js:165: ReferenceError: Server is not defined
            Server.addOnStart({name: 'Schemas', func: onStart});
            ^
    ReferenceError: Server is not defined
        at /usr/local/silkjs/modules/Schema.js:165:9
        at /usr/local/silkjs/modules/Schema.js:908:6
        at /usr/local/silkjs/modules/Schema.js:912:2
        at /usr/local/silkjs/modules/Schema.js:915:2
        at runScript (/usr/local/silkjs/builtin/require.js:12:20)
        at require (/usr/local/silkjs/builtin/require.js:116:31)
        at Server.js:11:11
    I'd love to help out here but it looks like my lack of fundamental understanding of your framework is getting in my way. It seems as though the Schema require expects a global Server object but I don't see how or where that would have been initialized, etc. The README is completely empty, but I've run into this problem with a lot of node projects as well, my assumption is your code is out of date from the latest SilkJS build.

    In either case this all looks promising! I'm looking forward to working with it!

  2. #12
    Sencha - Community Support Team mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,053
    Vote Rating
    17
    mschwartz will become famous soon enough mschwartz will become famous soon enough

      1  

    Default


    did you?

    sudo make install

    to install silkjs

    Then you git clone the SilkJS-extjs4 repo somewhere else. I have something like:

    /home/mschwartz/src/SilkJS
    /home/mschwartz/src/SilkJS-extjs4

    In the SilkJS-extjs4 directory is a config.js where you override the default configuration options installed with SilkJS.

    Edit that. Make sure you have the db and credentials created in MySQL to match what you have in config.js.

    In the SilkJS-extjs4 directory:

    $ http-silk.js ./server.js

    And then point your browser at http://localhost:9090/

  3. #13
    Sencha - Community Support Team mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,053
    Vote Rating
    17
    mschwartz will become famous soon enough mschwartz will become famous soon enough

      1  

    Default


    I realize it may not be obvious, but the simplest "server.js" type file you can make looks something like:

    Code:
    Config.documentRoot = 'path_to_your_document_root';
    Then you put your files in "path_to_your_document_root" like you would with apache.

    So assuming:

    /home/mschwartz/src/SilkJS-test (where I make a test project)
    /home/mschwartz/src/SilkJS-test/server.js (the one Config line above, documentRoot='docroot')
    /home/mschwartz/src/SilkJS-test/docroot/ (directory for documentRoot)

    Then inside docroot/, index.html served like apache would, docroot/foo/bar.html would be served for the url http://localhost/foo/bar.html, etc.

  4. #14
    Sencha Premium Member natedsaint's Avatar
    Join Date
    Jul 2012
    Location
    Fort Worth, TX
    Posts
    21
    Vote Rating
    3
    natedsaint is on a distinguished road

      0  

    Default


    Hmm, so in your example, your http-silk.js is the server file you've created?

    I installed silkJS from source using github, checked out your source, and then ran this from the command-line:

    silkjs server.js

    (again, I'm thinking from the node model, so my assumption was server.js was the wrapper script for everything)

    So now my assumption is that I need to make a wrapper script (in your example http-silk.js) and then feed it your specific server config?

  5. #15
    Sencha - Community Support Team mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,053
    Vote Rating
    17
    mschwartz will become famous soon enough mschwartz will become famous soon enough

      1  

    Default


    Quote Originally Posted by natedsaint View Post
    Hmm, so in your example, your http-silk.js is the server file you've created?

    I installed silkJS from source using github, checked out your source, and then ran this from the command-line:

    silkjs server.js

    (again, I'm thinking from the node model, so my assumption was server.js was the wrapper script for everything)

    So now my assumption is that I need to make a wrapper script (in your example http-silk.js) and then feed it your specific server config?
    Here's a way to think about it.

    SilkJS is like Perl in some respects. It's a command line program (written in C/C++). You give it a script on the command line and it loads it, runs it, then exits. The difference is SilkJS uses v8 and JavaScript as the language vs. the Perl language.

    You can write a WWW server in pure Perl. I've done it at least once back in the day...

    http-silk.js is a WWW server written in pure JavaScript. It's a program loaded and run by the silkjs program. The JavaScript code never exits because there's a while (true) loop at the end.

    httpd-silk.js takes the name of a script on the command line that is the www application you want to run. You can name this script server.js, foo.js, myOwnGoodness.js or whatever. Your app script is going to inherit the basic things that http-silk.js provides. Like the global Config object. You can override the defaults in Config by assigning to it. It's just plain old JavaScript

    httpd-silk.js uses what is called shebang. The first line of the script is #!/usr/local/bin/silkjs. This is not valid JavaScript, but the silkjs program replaces #! with // before running the first JavaScript file on the command line, effectively turning it into a valid comment.

    The effect of shebang is that the Unix command line interpreter (bash, csh, whatever) sees the #! on the first line and passes the rest of the script to the program specified (/usr/local/bin/silkjs).

    So you can use shebang in any JavaScript (for silkjs) you want to be able to run. That is, http-silk.js can be run:

    $ http-silk.js

    This is identical to:

    $ /usr/local/bin/silkjs /usr/local/bin/http-silk.js

  6. #16
    Sencha Premium Member natedsaint's Avatar
    Join Date
    Jul 2012
    Location
    Fort Worth, TX
    Posts
    21
    Vote Rating
    3
    natedsaint is on a distinguished road

      0  

    Default


    I apologize for not making it clear enough.

    I unfortunately have enough years of experience with Perl that I'm very familiar with the she-bang at this point. I think this issue is that my path was not set up correctly to use your http-server.js script included with SilkJS without calling the full path, and I was trying to figure out how things work directly.

    So ultimately I think this works the way I expected (you call the interpreter and feed it the appropriate scripts) but I didn't realize when you built this particular setup it was harnessed through http-server.js. Looking at your server script this could be done as a one-off in another way, so I think I get it all now!

    I'm tied up with something else at the moment but I'm excited about getting in there and messing with this later. Thanks for your prompt feedback! I wish any of my other threads was this productive in this forum!

  7. #17
    Sencha - Community Support Team mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,053
    Vote Rating
    17
    mschwartz will become famous soon enough mschwartz will become famous soon enough

      0  

    Default


    Quote Originally Posted by natedsaint View Post
    I apologize for not making it clear enough.

    I unfortunately have enough years of experience with Perl that I'm very familiar with the she-bang at this point. I think this issue is that my path was not set up correctly to use your http-server.js script included with SilkJS without calling the full path, and I was trying to figure out how things work directly.

    So ultimately I think this works the way I expected (you call the interpreter and feed it the appropriate scripts) but I didn't realize when you built this particular setup it was harnessed through http-server.js. Looking at your server script this could be done as a one-off in another way, so I think I get it all now!

    I'm tied up with something else at the moment but I'm excited about getting in there and messing with this later. Thanks for your prompt feedback! I wish any of my other threads was this productive in this forum!
    If you do:

    $ sudo make install

    in your SilkJS directory, where you built silkjs per the directions, then http-silk.js, silkjs, etc., should be on your path if you have /usr/local/bin on your path.

    SilkJS installs itself in /usr/local/silkjs, so it's trivial to remove.

    Other than /usr/local/silkjs, it creates a softlink in /usr/local/bin to the silkjs binary and to http-silk.js (which is actually linked to /usr/local/silkjs/httpd/main.js)

    Hopefully that helps you fix the path issues.

  8. #18
    Sencha Premium Member natedsaint's Avatar
    Join Date
    Jul 2012
    Location
    Fort Worth, TX
    Posts
    21
    Vote Rating
    3
    natedsaint is on a distinguished road

      0  

    Default


    Bah, my pathing was screwed up by a bad config. I updated and re-sourced all my shell files and it's working now! Very interesting stuff.

    Now that 4.2 has gone GPL I'm debating trying some things out with it. I'll update when I get something working. Thanks again!

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar