I tried npm module on client side.First i declare server side
Youtube = Meteor.npmRequire "youtube-video-api"
But I want YouTube value on client side.How to i get this one.
Related
I've been using #aws-sdk/client-dynamodb server-side (SvelteKit / NodeJS) connecting to localhost Docker container with instance of amazon/dynamodb-local:latest which works well. I used AWS CLI to configure tables, etc. I've created the client using the simplest configuration:
const client = new DynamoDBClient({ endpoint: 'http://localhost:8000' });
This works server-side, but when the same is executed client-side along with a command, I get a message that the region is missing. I've tried passing region: 'none', but then I get a message that the credentials are missing. Adding dummy credentials enables the command to execute, but I don't get an expected response. For example, sending the ListTablesCommand returns an empty array. If I do the same from the AWS CLI, I get the correct response.
Does the DynamoDB client run client-side, i.e., in the browser? Or am I missing something else?
No it doesn't run in a browser, You will need API Gateway and some backend code to connect a browser to Dynamodb.
I'm trying to query a rails server running locally through getInitialProps, however I keep getting an error
Error: connect ECONNREFUSED 127.0.0.1:3000 at TCPConnectWrap.afterConnect
I know there's nothing wrong with the rails server as I can query it just fine through Postman and another non-next react application. Is there some extra config you need to pass to next.config.js to query another locally running server?
I have a WebApi that was made using Asp.net Core 2.0 and consuming this API an Angular 5 App. Now I'm making a new version of this App using Angular 6.
In this Web API I use SignalR 1.0.0-alpha-final and in the Angular 5 app I use this as client "#aspnet/signalr-client": "^1.0.0-alpha2-final".
In the old Angular App everything works fine as intended. My problem is that I can use this package on the new version of my app:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! #aspnet/signalr-client#1.0.0-alpha2-update1 install: `echo "This package has been deprecated. Use '#aspnet/signalr' instead." && exit 1`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the #aspnet/signalr-client#1.0.0-alpha2-update1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Then I try to use the recommended version, I follow this article and everything runs OK on the Angular 6 App side, but it never actually connects to the Hub. this is the message I get when running my local Angular APP:
Access to XMLHttpRequest at 'http://localhost:27081/hub/notification/negotiate?jwttoken=the_token_here' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
It's not a real CORS problem, I made the WebAPI and and Angular APP run in the same domain and I never had CORS problem in my old App. I have the right Cors policies to allow localhost to use the api.
It's weird that the client added negotiate to the connection URL and even If I make my hub answer in this address I get error 400 with this message: Connection ID required
I do believe that this Client Library was made to another version than the one I have on the server, since the client and server has to follow the same version.
I tried using the node_modules from the older Angular App but I cannot get it to compile.. I don't know what to do. Has anyone experienced this issue and managed to solve? Any tips? I can't update the version on the WebAPI or I'll make the current App stop working.
Thanks for any help
I just got to make it work without changing the version of the webapi. This is how I make the connection:
this._hubConnection = new signalR.HubConnectionBuilder()
.withUrl('http://localhost:27081/hub/notification/?jwttoken='+ this.jwt,
{
accessTokenFactory: ()=> this.jwt ,
skipNegotiation: true,
transport: signalR.HttpTransportType.WebSockets
})
.build();
That's all. Yes, in the version I have in the API i have to send the token in the querysting. This documentation helped me achieve that.
You should update to the latest .Net core SignalR if you can
This include the client script #aspnet/signalR (currently 1.0.4)
With the latest Nuget Package Microsoft.AspNetCore.SignalRCore (currently 1.0.4)
Also note that initialising the hub in javascript changed from the preview version, looks something like this:
var connection = new signalR.HubConnectionBuilder().withUrl("/yourhub/").build();
We are running a simple application that connects to Firebase are reads some data. It fails to connect with the following timeout error:
#firebase/database: FIREBASE WARNING: {"code":"app/invalid-credential",
"message":"Credential implementation provided to initializeApp()
via the \"credential\" property failed to fetch a valid Google OAuth2 access token
with the following error: \"Failed to parse access token response: Error: Error
while making request: connect ETIMEDOUT
We are behind Firewall / Proxy and it appears that is blocking traffic to/from Firebase and hence failed connection. My question is what ports need to be opened and to what destination URLs to make this application work normally?
Any help will be much appreciated!
Finally, after struggling with the issue for several days got it working. Needed to contact network team and request to perform following actions:
Open ports 5228, 5229, 5230 for Firebase communication.
Opened communication at proxy level between the source server and following URLs:
fcm.googleapis.com
gcm-http.googleapis.com
accounts.google.com
{project-name}.firebaseio.com
Added following code in my node.js application:
var globalTunnel = require('global-tunnel-ng');
globalTunnel.initialize({
host: '<proxy-url>',
port: <proxy-port>,
//proxyAuth: 'userId:password', // optional authentication
sockets: 50 // optional pool size for each http and https
});
Installed module global-tunnel-ng:
npm install global-tunnel-ng
It solved the my problem and I hope it can help others too. :-)
I used Wireshark to monitor a local install of a Node.js application using the Admin SDK for firestore. I also referenced this list by Netify. This is what I found:
*.firebaseio.com
*.google.com
*.google-analytics.com
*.googleapis.com
*.firebase.com
*.firebaseapp.com
I'm trying to use socket.io in my spotify app and the get request for [domain]/socket.io/socket.io.js keeps getting canceled. I've added the domain to the manifest and everything.
Thanks!
Try restarting Spotify. Your app's manifest.json file is loaded when you first view your app, and cached until you quit, even if you modify it.
Note: How external resource permissions work
In order to request external resources, your application needs to specify each domain it plans to connect to in its manifest.json file.
Add a line like this:
{
// ...
"RequiredPermissions": [ "http://*.spotify.com", "http://spotify.com", "http://test.example.com" ]
// ...
}
For the full details check out the Permissions section of the Spotify Apps API Guide.
I can add that when you use socket.io it will try to initialize Flash to check if flash is available so if you find a white box in Spotify (only in Windows), remove the swbobjects initialization in the socket.io.js on the node server.