You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.
Explain the server stack provided by generator-thorax and how to run the client side compilation decoupled from the server(which previously was not possible)
New tasks provided:
grunt noserver grunt autotest:noserver
Which do the same as their counterparts, grunt and grunt autotest but without booting a server(normally done via grunt-contrib-connect).
Booting a server can then be done with Nodemon(or any tool of choice) in a separate window allowing these two parts of development to be decoupled.
An example server file has been provided within server/server.js and will work for most use cases during development. It is meant only to be an example and is not exhaustive, therefore no persistence layer is included(for example).
Building a node server is an exercise left to the user and generator-thorax tries not to enforce an opinion in this regard.
Note that server/server.js will is also be used by grunt-contrib-connect as middleware when running grunt and grunt autotest, thereby reducing duplication.
Also note that server/server.js is not booted by the Procfile nor is it referenced via npm start(used by nodejitsu). Both of those setups reference ./server.js which is a very light stub server file meant only to provide the bare minimum needed to server the ./dist directory.
To summarize: (aka, essentially rough draft version 2)
server/server.js server public and it's assets and provides can be run alone during rapid development by running grunt with the noserver oriented tasks mentioned above. Furthemore, server/server.js is also used as middleware for grunt-contrib-connect when running grunt default or grunt autotest
./server.js will only server ./dist and is therefore mean to be used when deploying to Heroku(it is referenced in the Procfile) or nodejitsu(referenced in package.json npm start command).
Side Notes:
At some point in the future we'll likely remove ./server.js and simply use server/server.js to server both public and dist, however this idea may or may not be a good idea, please open an issue if you feel strongly either way. The current implementation is more flexible but obviously requires more thought and configuration.
The above is a rough draft, (well 2 versions of it really) -- something more formal needs to be added to the README and/or perhaps the server files should be consolidated.
@mulderp - i know you we're curious about this a while back. Sorry for the delayed response. Curious about whether the above makes any sense or needs better wording.. or what your thoughts are in general here
The text was updated successfully, but these errors were encountered:
Another trend to consider is that @noBackend approach, e.g. firebaseapp etc. I am still considering a local API more convenient for development, but maybe for production that might be important to switch/mount the app differently.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Explain the server stack provided by generator-thorax and how to run the client side compilation decoupled from the server(which previously was not possible)
New tasks provided:
grunt noserver
grunt autotest:noserver
Which do the same as their counterparts,
grunt
andgrunt autotest
but without booting a server(normally done via grunt-contrib-connect).Booting a server can then be done with Nodemon(or any tool of choice) in a separate window allowing these two parts of development to be decoupled.
An example server file has been provided within server/server.js and will work for most use cases during development. It is meant only to be an example and is not exhaustive, therefore no persistence layer is included(for example).
Building a node server is an exercise left to the user and generator-thorax tries not to enforce an opinion in this regard.
Note that server/server.js will is also be used by grunt-contrib-connect as middleware when running
grunt
andgrunt autotest
, thereby reducing duplication.Also note that server/server.js is not booted by the Procfile nor is it referenced via npm start(used by nodejitsu). Both of those setups reference ./server.js which is a very light stub server file meant only to provide the bare minimum needed to server the
./dist
directory.To summarize: (aka, essentially rough draft version 2)
server/server.js
server public and it's assets and provides can be run alone during rapid development by running grunt with thenoserver
oriented tasks mentioned above. Furthemore,server/server.js
is also used as middleware forgrunt-contrib-connect
when runninggrunt default
orgrunt autotest
./server.js
will only server./dist
and is therefore mean to be used when deploying to Heroku(it is referenced in the Procfile) or nodejitsu(referenced in package.json npm start command).Side Notes:
At some point in the future we'll likely remove
./server.js
and simply useserver/server.js
to server bothpublic
anddist
, however this idea may or may not be a good idea, please open an issue if you feel strongly either way. The current implementation is more flexible but obviously requires more thought and configuration.The above is a rough draft, (well 2 versions of it really) -- something more formal needs to be added to the README and/or perhaps the server files should be consolidated.
@mulderp - i know you we're curious about this a while back. Sorry for the delayed response. Curious about whether the above makes any sense or needs better wording.. or what your thoughts are in general here
The text was updated successfully, but these errors were encountered: