I'm able to run a parse server like this:
parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test
But I'm wondering if it's possible to set the public path for static page when using parse-server command line ?
Use:
parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL https://myaddress.com
For the full list of available options, run parse-server --help or take a look at: http://parseplatform.org/parse-server/api/master/ParseServerOptions.html
Related
I'm trying to use the json-server and when I run the command json-server --watch jb.json the home link, e.g., https://localhost:3000, is not rendered due to the following error in the console.
Essentially this image below is where I'm trying to land when clicking on the link.
✅ Solution: After asking around, I found that creating a json-server.json file in the root of your project and adding the following custom configuration works for me:
{
.`.`.`,
"static": "./node_modules/json-server/public"
}
Essentially, you call the home route, e.g., https://localhost:3000, from the static root directory, not the public directory, because it's located in your app. https://github.com/typicode/json-server/issues/1100
I have two npm packages that are private repositories hosted on gitlab.com under a group organization.
My first package lives well and get updated and downloaded by users of the same organisation.
To install a private scoped package, the doc says:
# Set URL for your scoped packages.
# For example package with name `#foo/bar` will use this URL for download
npm config set #foo:registry https://gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/
So my .npmrc looked like
#mygroup:registry=https://gitlab.com/api/v4/projects/<id-project-1>/packages/npm/
//gitlab.com/api/v4/projects/<id-project-1>/packages/npm/:_authToken=<token>
//gitlab.com/api/v4/projects/<id-project-2>/packages/npm/:_authToken=<token>
//gitlab.com/api/v4/packages/npm/:_authToken=<token>
Obviously, everything works fine for the first package but not for the second one.
What I can't understand is why a scoped package should refer to a unique project url?
Because of this, I can't install both of my packages: the url of my scoped packages will only be valid for one of them.
I looked at the api endpoint to return a list of my group's packages I found this:
https://docs.gitlab.com/ee/api/packages.html#within-a-group
So I updated my .npmrc to
#mygroup:registry=https://gitlab.com/api/v4/groups/mygroup/packages/npm/
//gitlab.com/api/v4/projects/<id-project-1>/packages/npm/:_authToken=<token>
//gitlab.com/api/v4/projects/<id-project-2>/packages/npm/:_authToken=<token>
//gitlab.com/api/v4/packages/npm/:_authToken=<token>
But it doesn't work.
On the group/group-id/packages route I only get gitlab infos but nothing in an npm friendly format.
How to install more than one private scoped npm package hosted under the same group?
The instance level endpoint seems answer to your situation instance-level-npm-endpoint
Using:
npm config set #mygroup:registry https://gitlab.example.com/api/v4/packages/npm/
npm config set -- '//gitlab.example.com/api/v4/packages/npm/:_authToken' "<your_token>"
You should be able to publish #mygroup/project1 & #mygroup/project2
I experienced some troubles using yarn (1.22.10) so I'll post more details here just to save couple of hours to anybody reading this.
For some unknown reasons I was able to install the package with npm but not with yarn and I got Request failed \"404 Not Found\"
I ended up by creating a .npmrc file at the root of the project (I'm working with docker) with the following content:
#my-org:registry=https://gitlab.com/api/v4/packages/npm/
//gitlab.com/api/v4/packages/npm/:_authToken=<GITLAB_TOKEN_API_SCOPE>
//gitlab.com/api/v4/projects/<ID_PROJECT_1>/packages/npm/:_authToken=<GITLAB_TOKEN_API_SCOPE>
//gitlab.com/api/v4/projects/<ID_PROJECT_2>/packages/npm/:_authToken=<GITLAB_TOKEN_API_SCOPE>
Line 3 and 4 are required for yarn but not for npm.
To make it work replace #my-org by your gitlab organisation name, gitlab.com by the url where your projects are, <ID_PROJECT_X> by the ids of the projects you want to install and <GITLAB_TOKEN_API_SCOPE> by a personal token with an API scope.
While I am creating project API Doc. It causes more error. I have refereed this link.
as showed in guide http://www.yiiframework.com/doc-2.0/ext-apidoc-index.html#usage
you must invoke the command eg ( for apidoc api )
for windows enviroment
.\vendor\yiisoft\yii2-apidoc\apidoc.bat api ./docs/api
or
for linux enviroment
./vendor/yiisoft/yii2-apidoc/apidoc api ./docs/api
these command return the doc result in the directory ./docs/api
I'm following instructions on
https://laravelcollective.com/docs/5.1/ssh
in order to use SSH to perform SFTP download from a private server.
I've done so far:
$> composer require laravelcollective/remote
added in config app :
'providers' => [
....
Collective\Remote\RemoteServiceProvider::class,
...
]
'aliases' => [
....
'SSH' => Collective\Remote\RemoteFacade::class,
...
]
published it:
$> php artisan vendor:publish --provider="Collective\Remote\RemoteServiceProvider"
Then I also run a composer update
But still in my console command if I test it like:
$contents = SSH::into('production')->getString('/hi.txt');
dd($contents);
I get the error in my question.
When a service provider is defined like above, the class is globally accessible? Or still I need to put the directive use Path/to/Class ?
If so, since the Alias ahas a different name from the real classname, how should I specify the use path directive?
use Collective\Remote\RemoteServiceProvider
or
use Collective\Remote\RemoteServiceProvider
?
What am I missing?... I've tested other preconfigured services that comes with laravel 5.2 fresh install (i.e. Redis) and they seems to be found without any additional use directive in class.....
Thanks
Just use it as global class \SSH and it will work.
$contents = \SSH::into('production')->getString('/hi.txt');
dd($contents);
I want to upload a file to s3 so I want to run the upload program from this article:
http://www.componentix.com/blog/9
For this I need to install the multipart module.
https://github.com/isaacs/multipart-js
But by doing npm install multipart it is giving error
How should I install this multipart module so that I can get this program running?
You can download the full repo (not just the lib folder) into your application under a folder with the name node_modules.
Once you do that, your require will just be:
var multipart = require('multipart');
This is due to the way node resolves module dependencies. It will always look for a node_modules directory at the root of your app (and a few other places as well).
It's important you download the full repo and not just the lib folder if you plan to use it this way since the package.json file is used to find the main entry point.
{ "name" : "multipart"
, "version" : "0.0.0"
, "description" : "A JavaScript library for parsing and writing multipart messages"
, "contributors" :
[ "Isaac Z. Schlueter <i#izs.me>"
, "John Wright <mrjjwright#gmail.com>"
]
, "repository" :
{ "type" : "git"
, "url" : "http://github.com/isaacs/multipart-js.git"
}
, "main" : "lib/multipart"
}
The advantage of this is compatibility with using npm install locally in your dev machine.
You can also download the tar file form github. Hit the Download button and deploy that with your app. Once that is done in your server you can run
npm install <path-to-the-tar-file>
That will install multipart on the machine for you.
Download lib folder from the https://github.com/isaacs/multipart-js (including all the files inside it).
Put all those files next to your node application in the same folder.
On the top of your application file where you have included other modules like HTTP etc. ..append this >
var multipart = require("./multipart")