Proget Bower feed throws error - bower

While using a P{roget Bower feed, we are getting the following error. I don't seem to find solution anywhere on the internet.
EINVRES Response of request to http://*****/feeds/bower/Bower/packages/packages/bootstrap is not a valid json
Here is my .bowerrc
{
"proxy":"http://****:3500",
"https-proxy":"http://****:3500",
"http-proxy":"http://****:3500",
"strict-ssl": false,
"registry": {
"search": [
"http://*****/feeds/bower/Bower",
"https://registry.bower.io"
]
}
}
I will appreciate any help to resolve the issue. Thanks

When running Bower, use the feed endpoint URL, e.g.:
http://proget/bower/{bowerFeedName}/...
instead of the Feed Overview URL, e.g.:
http://proget/feeds/{bowerFeedName}/
The latter is meant for browsing via the web UI.

Related

How can I fix the error: "Cannot POST /users. StatusCode: 404" while making a POST request in Postman?

I'm following the article while working on the project.
When making a POST request in Postman:
http://localhost:3000/users
With Body request:
{
"name": "Jose Luis",
"lastName": "Campos Bautista"
}
I'm getting the issue as:
{
"statusCode": 404,
"message": "Cannot POST /users",
"error": "Not Found"
}
Am I missing something in the steps of the article? Does it the problem related specifically to API?
Inside the controller I have annotated as users:
#Controller('users')
Before executing a Postman request, I run the command:
npm run start:dev
Also I use the Postgres database with the next format of configuration:
DB_URL=postgres://user:password#localhost:5444/dataBaseName
ENTITY_PATH=dist/**/**/*.entity{.js, .ts}
Thanks in advance for any reasonable advice/ideas on how I can overcome this issue.
I have looked in your git repo. You should insert some route inside your controller like this
#Post('/create')
Your service is also lacking await before calling the save method in your service. It should be like
async create(user: UserDto): Promise<UserDto> {
return await this.userRepository.save(user);
}
and your controller should be like
#Post()
async create(#Body() user: UserDto): Promise<UserDto> {
return await this.userService.create(user);
}
You also don't have a connection initialization inside your app.module.ts so your API wouldn't be able to save data inside database.
Your UserModule is never registered with the application. The AppModule needs to have UserModule in its imports array. Just because the file exists and is written doesn't mean Nest knows what to do with it. You have to tell the application that the module should be used by having it in the imports path of some module that eventually makes its way back to the root module (usually AppModule)
Side Note: when you do that, you will get an error from TypeORM because you call TypeormModule.forFeature() without ever importing TypeormModule.forRoot(), so just a heads up that you need to add that

Is Parse's server down ahead of schedule or am I missing something?

I haven't been able to contact Parse's server at all of the past week,
when I try to deploy my Cloud Code, the CLI gives me the following error:
When I try to add a new Cloud Code I get this error:
And back in Xcode, when I try to run my application, I get this error:
What is the issue here? And is there any fix to this?
I See that the errors have a sort of reference to go Lang, what does that have to do with the situation ?
Parse is (obviously) still available (for now!). It looks like an authorization error (i.e. wrong keys setup). Two things:
1. Update your Parse CLI SDK
Run an update to grab the latest parse CLI SDK:
`$ parse update`
Check your config.json has the correct keys in it
In your cloud code directory, there is a config/global.json file. This is what the ParseSDK uses to authenticate against Parse.com. Check the keys are correct for your app(s):
{
"global": {
"parseVersion": "1.4.2"
},
"applications": {
"YourAppName": {
"applicationId": "THE APP KEY HERE",
"masterKey": "THE MASTER KEY HERE"
},
"_default": {
"link": "YourAppName"
}
}
}

Can't read from file issue in Swagger UI

I have incorporated swagger-ui in my application.
When I try and see the swagger-ui I get the documentation of the API nicely but after some time it shows some error icon at the button.
The Error message is like below:
[{"level":"error","message":"Can't read from file
http://MYIP/swagger/docs/v1"}]
I am not sure what is causing it. If I refresh it works and shows error after few seconds.
I am guessing "http://MYIP/swagger/docs/v1" is not publicly accessible.
By default swagger ui uses an online validator: online.swagger.io. If it cannot access your swagger url then you will see that error message.
Possible solutions:
Disable validation:
config.EnableSwagger().EnableSwaggerUi(c => c.DisableValidator());
Make your site publicly accessible
Host the validator locally:
You can get the validator from: https://github.com/swagger-api/validator-badge#running-locally
You will also need to tell swaggerui the location of the validator
config.EnableSwagger().EnableSwaggerUi(c => c.SetValidatorUrl(<validator_url>));
To supplement the accepted answer...I just uncommented one line in the SwaggerConfig.cs. I only wanted to get rid of the red error on the main swagger page by disabling the validator.
// By default, swagger-ui will validate specs against swagger.io's online validator and display the result
// in a badge at the bottom of the page. Use these options to set a different validator URL or to disable the
// feature entirely.
//c.SetValidatorUrl("http://localhost/validator");
c.DisableValidator();
If you are using files from swagger-ui github repo, then you can disable schema validation from your index.html file by setting validatorUrl to null in it:
window.onload = function() {
// Build a system
const ui = SwaggerUIBundle({
url: "/docs/open_api.json",
dom_id: '#swagger-ui',
validatorUrl : null, # <----- Add this line
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})
If you using PHP Laravel framework with L5-Swagger just uncomment
'validatorUrl' => null,
from the config file /config/l5-swagger.php
Setting this.model.validatorUrl = null; in dist/swagger-ui.js worked for me ..
// Default validator
if(window.location.protocol === 'https:') {
//this.model.validatorUrl = 'https://online.swagger.io/validator';
this.model.validatorUrl = null;
} else {
//this.model.validatorUrl = 'http://online.swagger.io/validator';
this.model.validatorUrl = null;
}
To anynoe having similar issue when using Swashbuckle.OData:
I was having issues to integrated Swagger with our OData endpoints (using ODataController for API and Swashbuckle.OData NuGet package). I had to write our own document filter for it and add it:
GlobalConfiguration.Configuration
.EnableSwagger(c =>
{
c.SingleApiVersion("v1", "OurSolution.API");
c.DocumentFilter<SwaggerDocumentFilter>();
//c.CustomProvider((defaultProvider) => new ODataSwaggerProvider(defaultProvider, c, GlobalConfiguration.Configuration));
c.IncludeXmlComments(GetXmlCommentsPath());
c.UseFullTypeNameInSchemaIds();
c.RootUrl(req => ConfigurationManager.AppSettings["AppUrl"]);
})
.EnableSwaggerUi(c =>
{
c.DisableValidator();
});
Apparently in order to avoid validation error I had to comment out line which is setting ODataSwaggerProvider along with turning off validator as mentioned in posts above. This makes usefulness of Swashbuckle.OData questionable yet I didn't test whatever it works with vanilla Swashbuckle.
Note: I used approach described on GitHub page for Swashbuckle.OData but it was not working: showing no possible endpoints at all. Maybe somebody knows better solution.

CouchDB Update XML Attachement

Ive read at least 5 articles on this but I can't seem to get it. I have an xml file that is already in memory in the browser and I am attempting to update a document from my db, for which I already have the doc id. What is the best way of doing this? Is there support for this built into jquery.couch.js, because I can't seem to find any.
Ive attached some code with hard coded values for the sake of my sanity:
var xmlTemp = this.fullscoreApp.MusicXML.document;
$.couch.db("mydb").saveDoc({
"_id": "67e98623efefe16d27e2177b44000aee",
"_rev": "4-830aad7c3dc9e1d5004439ed1c9196d3",
"type":"score",
"_attachments":xmlTemp
}, {
success: function() {
console.log("PLZ");
}
});
I get a DOM 18 error...but I'm using a public server. Thoughts?
What protocol are you using to open your JavaScript file? Are you running it via a webserver (such as http://localhost) or just opening the file (which will show as file:// in the browser)?
If the latter, the browser will report DOM 18, because file:// suffers various restrictions not present for pages served by a webserver. More info from this question.

Swagger UI error: Unable to fetch API Listing

I'm documenting a REST web API with Swagger. I've downloaded the petstore example. It consists of the resources.json which references pet.json and user.json:
{
"apiVersion":"0.2",
"swaggerVersion":"1.0",
"basePath":"http://petstore.swagger.wordnik.com/api",
"apis":
[
{
"path":"/pet.{format}",
"description":"Operations about pets"
},
{
"path":"/user.{format}",
"description":"Operations about user"
}
]
}
But even after uploading the original files to my web server, Swagger UI tells me:
Unable to fetch API Listing. Tried the following urls:
http://www.myserver.org/resources.json
http://www.myserver.org
http://www.myserver.org/resources.json
http://www.myserver.org/resources
Can you tell what causes Swagger not find my json file?
I'm assuming you're going to www.myserver.org and it brings up the swagger ui? In the "Explore" textbox in the Swagger UI... be sure to type in the location of your resources.json.
I personally have my swagger api documentation set up this way...
http://adamclerk.com/api --Swagger UI
http://adamclerk.com/api/doc --returns json representing resources.js
http://adamclerk.com/api/doc/donuts --returns json representing donut operations
you can checkout a more detailed explaination here - Swagger With Static Documentation
If you have any more questions feel free to ask.

Resources