What is __meteor_bootstrap__? - meteor

I am just starting with Meteor and working on an existing project. I am running into an issue with one of the packages(observatory-apollo) that's has the following line:
__meteor_bootstrap__.app.use Observatory.logger #TLog.useragent
It is complaining that __meteor_bootstrap__.app is undefined.
What is __meteor_boostrap__ exactly? I can't seem to find a description of what it is but from threads, people seem to know how to use it. I can only see it defined in boot.js, but it doesn't really tell me much...

Meteor uses connect npm module under the hood for various reasons, to serve static files, for example. __meteor_bootstrap__.app was the reference to connect app instance.
Before it was __meteor_bootstrap__.app but it changed couple of releases ago and became WebApp.connectHandlers object and is part of WebApp package.
WebApp is a standard package of Meteor, core package for building webapps. You don't usually need to add explicitly as it is a dependency of standard-app-packages.
Example of usage the connectHandlers is to inject connect middlewares in the same way as you would use any connect middleware (or some express middlewares, express is built on top of connect):
WebApp.connectHandlers
.use(connect.query())
.use(this._config.requestParser(bodyParser))
You can look at meteor-router Atmosphere package and take it as an example: https://github.com/tmeasday/meteor-router/blob/master/lib/router_server.js
More about connect: https://npmjs.org/package/connect

Related

Error: "The type or namespace name 'SshClient' could not be found" .NET 6

hoping I can get a little guidance as to why it seems like I'm unable to use the SSH.NET package in my .NET Core project. I have a simple web API that I'd like to wire up to an existing MySQL database, and since there's no easy integration with MySQL in Visual Studio 2022 yet (shame), I figured this would be good practice for me to use SSH tunneling to connect to the host machine and use port forwarding to connect to the database therein. What's weird is that after installing the SSH.NET NuGet package, I can't seem to actually use it. Like, I can't use any of the documented methods. I won't bother posting the rest of my code as it's really just the one line that's failing:
using (var client = new SshClient("sftp.foo.com", "guest", "pwd"))
...
Intellisense immediately complains and tells me that the name 'SshClient' can't be found. I'd like to actually solve this issue rather than rework much of this project to use EntityFramework or whatever. It's just really bumming me out that the current state of .NET doesn't want to play with MySQL. Any help would be greatly appreciated, and further context can be provided if needed, of course.

Xamarin.Forms UI Test Environment

I am trying to set up my Xamarin.Forms application to use UI Tests. Currently the tests are working fine, but I would like to be able to mock or handle the API calls that the application calls, rather than the actual API calls being executed in the tests.
There appears to be a way that UITest can detect if it is running in Test Cloud, but I can't seem to find a way for the application to know if it is running tests locally. I am using an IoC Container to register the various interfaces that interact with these APIs, and would like the App constructor to be able to detect if it is running a UITest, then register the appropriate 'actual' interface instances or the 'mock' instances. Is there a known way to handle this?
Your issue can be solved in many ways, but this is what I actually do:
You can create a dedicated compiler configuration:
Then, based on the configuration you would manipulate your container boostrap pointing your interfaces to the mock objects.
Whenever you want to run UI tests you would compile this configuration instead of the release configuration.

Ionic using PounchDB fail

I`m testing PounchDB for my new app and, i receive this error when try execute this code:
PouchDB.plugin(require('pouchdb-adapter-cordova'));
_db = new PouchDB('mydb.db', {adapter: 'cordova-sqlite'});
Erro received:
ReferenceError: Can't find variable: require
I follow instructions from: https://github.com/nolanlawson/pouchdb-adapter-cordova-sqlite
Using ionic 1.
You're using require without an associated package manager or module bundler. require is not native to JavaScript -- you have to include a library or package your app in order for this to work.
I suggest JSPM (http://jspm.io), since it works with SystemJS and supports the newest ES2015 module syntax. However, it also understands require.
Alternatively, you can use Browserify(http://browserify.org) to bundle your code (essentially Browserify packs everything into one file, which is great for production!). Webpack(https://webpack.github.io) is also a great option. Both of these will add a build step to your development workflow, so be aware of that (but you should have one anyway).

what is api-paste.ini file in openstack

I've seen api-paste.ini as a conf file after installing openstack.
It looks like substituting some prefixes for python implementation but have no clue about this.
Here, my questions are:
What script is it?
it looks like very bizarre grammar like the following:
[composite:metadata]
use = egg:Paste#urlmap
/: meta
How does it work within python script?
See documentation for Paste Deploy.
The api-paste.ini is the configuration for the above web-services framework. Paste.deploy allows you to separate concerns between writing your application and middleware/filters from the composition of them into a web service. You define you WSGI applications and any middleware filters in the configuration file then you can compose pipelines which include the middleware/filters you want into your web-service, e.g. authentication, rate-limiting, etc.
You want to temporarily remove authentication, take it out of your pipeline and restart your web service.
The declaration above is declaring a composite application, but with only one application binding (a bit unnecessary - normally you would expect to see more than one binding, e.g. for different versions of the application). The WSGI application app:meta will be bound to / and you should have a declaration of app:meta later in the file. The implementation of the composite app is declared via the use and the egg:Paste#urlmap is a simple reference implementation.
You load this in your program with paste.deploy.loadwsgi.loadapp().
There is a proposal/recommendation(?) to move away from Paste Deploy/WebOb to WSME/Pecan see OpenStack Common WSGI

transmogrifier without plone

I'd like to user c.transmogrifier outside plone. How far is it from being plone-independent?
Actually I see very few plone-related imports and plone-only-specific code inside the trunk so that it seems feasible.
Is there any roadmap or any todo/advice list for getting this?
I've created a runner for executing transmogrifier outside of plone via a commandline tool. At the moment that runner is part of funnelbweb. You can use the funnelweb script to run your own pipelines via "funnelweb --pipeline=mypipeline.cfg"
However we are in the process of migrating that code into a general module called mr.migrator. Mr.migrator will be both a commandline runner for transmogrifier pipelines and also a Plone UI to do the same.
collective.transmogrifier only depends on CMFCore, not Plone. I do have plans to make that dependency optional though, I simply haven't had the time to do so yet.

Resources