Meteor documentation states
Meteor ensures that any file in any directory named server/ will only be available on the server
but what about subdirectories (and their corresponding files) in the server folder? Are they only accessible via the server too? e.g...
server/
server.js
myfolder/
fileIOnlyWantToBeAccessibleByTheServer.js
anotherFileIOnlyWantToBeAccessibleByTheServer.js
client/
client.js
common/
common.js
sub-directories of server are not sent to the client. from here: https://guide.meteor.com/structure.html#special-directories
Any directory named server/ is not loaded on the client.
thought it doesn't explicitly spell out sub-directories, i think it's implied from that statement. also, from experience, i can say the subdirs are not sent.
Related
I'm trying to accomplish what seems like a simple task but having issues with the publish profile (pubxml) syntax to make this work
I'm using a web publish profile to push changes to our remote staging server, and I'm trying to include a global config file that's shared across our apps into a remote directory on that staging server into a folder that is 'outside' of the publish destination root folder.
Here's a basic sample folder layout of the source and destination:
Source file:
C:\dev\webapp1\Global.config
This is just a basic web config file in the project root.
The destination folders for our web apps would be:
C:\websites\Config
C:\websites\App1
C:\websites\App2
C:\websites\App3
App1 is the project with the publish profile I'm working with, so when I publish it needs to place the Global.config file into the websites\Config directory on the remote server.
So far I have:
<ItemGroup>
<ResolvedFileToPublish Include="Global.config">
<RelativePath>../Config/Global.config</RelativePath>
</ResolvedFileToPublish>
</ItemGroup>
I was hoping using the ../Config would back up a directory from the destination root and place the file in the remote server Config folder but it's placing it into the destination root folder (App1) instead.
Anyone know if this is possible?
How can I set up automatic selection of a remote directory based on the location of a local file?
Settings: "remote_path" "/site.ua/www/"
For example: the abs.php file is located on the local server along the path: /www/php/abs.php, and this plugin uploads all files to the root directory on the remote server /site.ua/www/abs.php
I need the files to be loaded into the appropriate directories.
UPD: at the same time, the js- and css-files are automatically allocated to the remote directory according to their location on the local server.
I'm trying to read a .json file in /public folder. Relative path I'm using is '../../../../../public/data.json' and it works when I run with meteor run.
However, when I deploy to meteor subdomain by running meteor deploy MyApp.meteor.com, it crashes and the logs say
Error: ENOENT, no such file or directory '../../../../../public/data.json'
I tried using 'data.json', 'public/data.json', etc. but I couldn't get it to work. What am I missing here?
Put the data in a "private" directory off of your app root instead of "public" (assuming that you're only going to read it on the server, which is what you seem to be doing). When you want the file (regardless of if you are deployed or not), it is at the path "assets/app/".
For example, if your app had the directory structure:
myApp.css
myApp.js
myApp.html
server/
serverCode.js
private/
data.json
You could use something like "peerlibrary:fs", which exposes fiber aware fs sync functions, and do the following in "serverCode.js"
var data = JSON.parse(fs.readFileSync("assets/app/data.json"));
If you put the file data.json in the root of the public folder you can just use the path "/data.json"
I'm working on a spring-mvc project and was wondering if, like grails, I can create an external configuration file in tomcat with the appconfig folder. My project lives in /var/lib/tomcat7/webapps/<app> and was wondering if placing a configuration file in /var/lib/tomcat7/appconfigs/<config.xml> would work? If so, is it like grails and the application searches that location by default, or do I need to specify where that configuration lives? Thanks
What do you mean by "external configuration file"? Would this config file be separate from the war file? Or would it be packaged along with war file?
If packaged along with war file, you can put it under src/main/resources folder and it should be automatically packaged and placed in classpath.
If not packaged with war file, I usually put the configuration parameters under Tomcat's context.xml. Here's the documentation: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Environment_Entries
Lets say that I have a directory /var/www/assets/ and within that directory I have a symlink which points to a folder which contains all the latest asset files for my website.
/var/www/assets/asssets -> /var/www/website/releases/xxxxxxx/public/assets
If I configure NGINX to serve asset files from /var/www/assets with the domain assetfilesdomain.com and asset files are prefixed with the directory /asset/ then when that /asset folder's symlink is changed then the updated link is not reflected in NGINX. The way that I see it, NGINX grabs the resolved path for that asset folder when it is started.
Is there any way to get around this?
Reloading nginx (sending a HUP signal to the master process) seems to solve this issue (probably because it starts new workers and shuts down the old ones, gracefully).
it seems like you're using Capistrano. You can override deploy:restart and put the nginx reloading there.