Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Guidance on directory structure and reload functionality
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Thomas Glock  
View profile  
 More options Sep 12 2012, 9:45 am
From: Thomas Glock <tgloc...@gmail.com>
Date: Wed, 12 Sep 2012 06:45:53 -0700 (PDT)
Local: Wed, Sep 12 2012 9:45 am
Subject: Guidance on directory structure and reload functionality

Question:

Is there any example on what the directory layout should/might be for node
and strata ?  

1. I created a directory: *D:\node_apps\app_1*
2. Changed to the app_1 directory and ran npm to download/install strata
via *npm install strata*
3. npm ran without errors and created a sub-directory named *
D:\node_apps\app_1\node_modules* containing \.bin and \strata
sub-directories.
4. I created the example file: *app.js* in the *D:\node_apps\app_1*directory.
5. I then switched to that directory and ran *node app.js* in a command
prompt.

And it worked the first time!!!   But this was my very first effort with
node and I am completely guessing as to a 'proper' directory structure and
looking for guidance.

Clearly need to be able to use the: $ strata -p 3000 -r 1 app.js

I am running on Windows 7 - can anyone provide details on how to get the
reload functionality to work ?

Thanks in advance and strata looks very nice indeed!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TG  
View profile  
 More options Sep 12 2012, 11:29 am
From: TG <tgloc...@gmail.com>
Date: Wed, 12 Sep 2012 08:29:05 -0700 (PDT)
Local: Wed, Sep 12 2012 11:29 am
Subject: Re: Guidance on directory structure and reload functionality

Update - I looked at the strata.js and the strata.cmd and am able to get
strata successfully execute for --help and --version.  I will also
correctly run when supplied the -d option to perform directory listings.
 However, when I try to run my app.js I get the error below.  I've checked
to see if anything else is on the port 1982 and there is nothing.  I think
that the code is perhaps executing twice or that my app.js needs to specify
a separate port than the strata monitor ?  If so, how do I do this ?

D:\node_apps\app_1>node_modules\.bin\strata -r10000 -p3000 app.js

>> Strata web server version 0.17.0 running on node 0.8.9
>> Listening on 0.0.0.0:1982, CTRL+C to stop

events.js:66
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: listen EADDRINUSE
    at errnoException (net.js:769:11)
    at Server._listen2 (net.js:909:14)
    at listen (net.js:936:10)
    at Server.listen (net.js:985:5)
    at startServer
(D:\node_apps\app_1\node_modules\strata\lib\index.js:165:12)
    at Object.run (D:\node_apps\app_1\node_modules\strata\lib\index.js:82:3)
    at Object.<anonymous>
(D:\node_apps\app_1\node_modules\strata\bin\strata:124
:10)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)  


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TG  
View profile  
 More options Sep 12 2012, 12:44 pm
From: TG <tgloc...@gmail.com>
Date: Wed, 12 Sep 2012 09:44:01 -0700 (PDT)
Local: Wed, Sep 12 2012 12:44 pm
Subject: Re: Guidance on directory structure and reload functionality

Another Update -
I ended up using node-dev and it works fine (apparently there are many
solutions in this space.)   https://github.com/fgnass/node-dev

Lots to learn here - especially with regard to http headers - it seems if I
use the strata.use(strata.contentLength) and the content-length header is
incorrect, the request hangs indefinitely.  If the content-length is not
specified then the transfer encoding is set as chunked and changes can be
made to the response data without issue.

Is there a good example in strata where I might find options regarding
Expires, Last modified etc. as they apply to serving static content ?  

I want to set an Expires header on certain static content such that the
static content never expires.  This is to minimize having to field
countless "If-Modified-Since" requests.  The application itself will
determine if the static content has changed and generate a
unique query-string param for the static content.  


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Jackson  
View profile  
 More options Sep 12 2012, 3:23 pm
From: Michael Jackson <mjijack...@gmail.com>
Date: Wed, 12 Sep 2012 12:23:24 -0700
Local: Wed, Sep 12 2012 3:23 pm
Subject: Re: Guidance on directory structure and reload functionality

Could you supply the code that's in app.js? You may accidentally be calling
strata.run twice, so it may be trying to bind to the port twice which is
causing the error.

--
Michael Jackson
@mjackson


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TG  
View profile  
 More options Sep 13 2012, 2:42 pm
From: TG <tgloc...@gmail.com>
Date: Thu, 13 Sep 2012 11:42:34 -0700 (PDT)
Local: Thurs, Sep 13 2012 2:42 pm
Subject: Re: Guidance on directory structure and reload functionality

Thanks for the reply, I lost that version of the code as I was just
exploring strata and node.  I've since dug into the node api docs and the
strata source and realize there is much to learn.  (For example, you can
see I had the -r and -p options specified incorrectly below!)  At any rate,
I appreciate the reply and I will continue exploring.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »