I have upgraded to sails v1.0 from v0.12
in sails v0.12 i had a directory api/blueprints that contained find.js, add.js etc.. that override the basic blueprint function for every model.
this doesn't seem to work under sails v1.0,
has it been moved? what should i do to override every blueprint action for my every controller?
You need to add this hook for overriding blueprints in 1.0
https://www.npmjs.com/package/sails-hook-custom-blueprints
Source:
Sails 1.0 docs
https://sailsjs.com/documentation/reference/blueprint-api
Related
Our project which was migrated from typo3 version 9 to version 10. The issue is storagepid = 0. I can hardcode the pid value to configuration. But that’s not a permanent solution. If I use same plugin in different project again I have to hardcode storagepid value. So I need a permanent solution to fix it out.Can anyone help me to find out the solution?
There is no need to hardcode the storagePid in PHP code, since TYPO3 Extbase plugins typically will fetch the storagePid(s) from configuration (either TypoScript, starting point or plugin settings).
This blogpost I wrote some years ago explains, how and in which order Extbase will determine the storagePid.
The most suitable way is to use the starting point setting in the plugin, which automatically will be taken into account when data is fetched (e.g. in a Extbase repository). This way, you can use the plugin in several projects and the editor can select the storagePid(s) directly in plugin settings.
I'm currently in the middle of upgrading our API from v0.12 of Sails to v1. Not the easiest task, but will be worth it.
The current problem I'm having, is converting our old "ModelName.query" calls to the new style, which is supposedly "sails.getDatastore". Great, fine.
Except, that when trying to do this in config/bootstrap.js, I constantly get the error "sails.getDatastore is not a function".
Yes, I am using the default sails-hook-orm, the .sailsrc has it turned on explicitly; and yes, I have globals turned on.
Is the problem that the function isn't registered until after bootstrap? Because that is not an option for us; bootstrap is validating our database schema before lift (custom code, using native queries), so our production servers fail to deploy if we missed a database update. It eliminates a ton of human error.
Thanks for taking the 1.0 plunge!
I'm not sure what you mean by the "default" sails-hook-orm -- that hook is installed directly as a dependency on each Sails 1.0 project -- but I can almost guarantee that the version you're using is not correct. I would do:
npm cache clean
npm install sails-hook-orm#beta
in your project to make sure you get the latest (currently v2.0.0-21). It adds getDatastore to the app object when it initializes.
I am trying to use Play to create a simple server in Scala.
I want to provide an endpoint for a webhook that is generated from a secret token set in an environment variable.
export SECRET_TOKEN="asntoehu"
I want to create a route like POST /asntoehu controllers.Application.webhook
I can't work out how to either pass such an environment variable to conf/routes file or how to manually override routing in my app.
I am using the scala play seed created by running sbt new playframework/play-scala-seed.g8
Scala 2.5 using Dependency Injection method (so can't use GlobalSettings override)
How should I do this?
Currently CloudBees' default Lift version is 2.4, and this is what you get when using the Lift ClickStart. What's the best way to use Lift 2.5-M1 instead? Create a ClickStart and override the default version, or some other way? Thanks!
The Clickstarts are designed to be "forkable" and updatable - if you want to use a newer lift version - take a look at:
https://github.com/CloudBees-community/lift_template
Fork it, change the pom.xml (as it currently uses the maven build type) ** - to use the appropriate version, and push your changes.
You can then rerun the clickstart via pasting a URL like the following into your browser
https://grandcentral.cloudbees.com/#CB_clickstart=https://raw.github.com/YOUR_GITHUB_ACCOUNT/lift_template/master/clickstart.json
and it will use the newer version. Submit a pull request if you like - so it is up to date for future.
If you have an existing app you created - you can just clone the git repo, update the pom.xml and push it - it will then update your app for you.
Here is a guide on making your own ClickStart: http://wiki.cloudbees.com/bin/view/RUN/How+to+make+your+own+Clickstart
My Play 2.0 application runs under different directories during development and in production:
During dev we use /, in production it runs as /crm/.
Is it possible to define a "root directory" of some sort for play?
This article suggests using the isDev() sort of methods and this one to use a config variable, but it seems like the routes file no longer allows code inclusion: adding %{ }—style tags to the routes file results in compilation errors.
In 2.0 or 2.0.1 you can't do it.
If you use the trunk-version you can define a property:
application.context="/AwesomePlayApplication"
This property can be set by in the usual way at production.
But this is only possible with the future version.
As there seems to be no other solution, I decided to go with a shell script that modifies the routes file on deployment and adds the necessary prefix to every route.