How to identify the URL of swagger-ui of the project? - swagger

My project is based in Scalatra. I have tried to use the swagger-ui to test my application on my local, but I had a hard time finding the correct url. I have tried to follow the same steps as in this post, the difference is that I have already had a self-defined webapp folder with a folder x inside that include the same structure as dist folder (i.e. index.html however it is self defined and standalone). I can have my swagger.json file located at http://localhost:8080/x/api-docs/swagger.json but cannot locate the correct path for the UI page as suggested in any answers of the post. May I know how should I identify the path for the home swagger UI page?

Related

Can you create URLs for files in sphinx regardless of where they are saved?

Can you change the location of 'rst' files in sphinx without changing their URIs? I'm working on a documentation where we want to move some files to different folders, without changing the URIs:
For Example: If you create a sphinx project with $ sphinx-quickstart and add some files and folders:
index.rst
/tutorials/howToFoo.rst
/scripts/
With the toctree in in index.rst looking like that:
.. toctree::
:maxdepth: 1
:caption: Processing:
:glob:
scripts/*
tutorials/*
Then after building the project with make html, you have a link in your browser as seen here: tutorials/howToFoo.html
If you want to save the the file in a different folder:
index.rst
/tutorials/
/scripts/howToFoo.rst
Then the URL of your file howToFoo.rst changes depending on where it is saved:
scripts/howToFoo.html.
This is a problem because I don't want links to tutorials or scripts to break.
As the project aims to include many people, it will be very probable that there will be changes in the file structure in the future.
Now my question: Can you create a setup where you can move the files without having to write redirects to their new location, every time you move them?
For Cross Referencing inside of Sphinx this is solved for example with targets, explained here:
https://docs.readthedocs.io/en/stable/guides/cross-referencing-with-sphinx.html#automatically-label-sections
But this doesn't help me because the link in the browser still stays the same.
What I want is a link SomeNeverchangingLinkFor_howToFoo.html regardless of where the file howToFoo.rst is saved.

How do you apply relative paths for locally developed HTML files

I know the subject line must sound really stupid. Of course you would locally develop HTML files - didn't know how to phrase it better since I'm a beginner at HTML+CSS.
So to get to the point:
I'm linking to images and pages on the HTML file I'm editing. However, when I open the HTML file in my browser locally the links are broken because I'm not using an absolute path. My preference is to use relative path because I'll be able to simply move my project file folder onto my server without having to change the URL paths in my HTML files.
My question is: How do I get the relative paths to point to where I want without having to list the entire drive directory?
Ex. My local HTML has the following line:
<img src="/images/logo.jpg">
But opening the local HTML file in my browser, the image is broken since it points to: file:///D:/images/logo.jpg
How do I get it to point to {local root}/images/logo.jpg instead?
What I did was to install a local development server such as EasyPHP, and setting the proper root folder within my project folder. Setting the root folder tells the local server where the root is, and so any relative paths work as expected.

Absolute path for img and js excluding project folder name Visual Web Dev

I've this little but annoying issue in my project in Visual Web Developer 2010 Express. I'm developing a website with .aspx files located in a large folder structure i.e. www.domain.com/group1/type1/somefile.aspx, the root folder contains a "styles" (for css), "images" and "js" (for javascripts) folder. I've read a lot about base tag, absolute and relative path today. Finally I realized "absolute path" is the best choice for me.
The main problem is that when I preview (locally) my site in browser the absolute links for image, css, and js are not working, I'm using src="/js/gl.jquery.js" which I believe is correct and will work online.
The source code of the page for the javascript says http://localhost:61700/js/gl.jquery.js, when I switch to relative path script src="../../../js/gl.jquery.js" and preview the website, it works fine, and the source code for the javascript path says http://localhost:61700/ProjectName/js/gl.jquery.js (Notice Visual Studio added the ProjectName in the path) So I'm taking my guess that when the project goes online (on a main domain) it will work correctly, but right now I need to keep developing locally without this issue. Is there a way to fix this in Visual Web Developer? maybe some tag for the web.config file that I can remove when goes online, or some website property?
I know a quick solution will be develop with the relative path, and modify the code when goes online to absolute path, but I'm looking for some cleaner method, as aditional information I didn't choose base tag because I read cause troubles with anchors links (href=xx.html#question3) and I need to use them at some big files. And avoid the relative path because it's possible that the company ask me to move some files in the future and I don't wanna be updating relative paths.
Thanks a Lot!
Problem solved! This is the solution I found Thanks to ScottGu's Blog.
I quote the main thing:
when opened a web-site and run the project, VWD launch and run the built-in web-server using a virtual app path that equals the project’s root directory name. For example: if you have a project named “Foo”, it will launch and run in the built-in web-server as http://localhost:1234/Foo/Default.aspx.
One downside to this is that it makes it hard to fully qualify things like static CSS and image files within your site (for example: using root qualified paths like /images/myphoto.jpg or /css/mycss.css). Note that you can use the “~” app path trick for dynamic resources – but static resources still end up being a pain (js, css, images files.) (This was my issue)
Here is the guy entire post: Click Here
Here is the main solution:
1) Using the solution explorer within Visual Studio, select the web-site project node, (the one with the World icon)
2) There is a properties named "Virtual path" at the bottom. Change the "virtual path" setting it to / to run as a root web-site.
And that's it, setting up the / I can manage my files easily.

why have most of the files in a dreamweaver site been put into a directory called 'upload'?

I cleaned up someone's style sheet for a Dreamweaver site, by editing the css directly, and now the secretary is having trouble using her old template.
Most of the files in her site reside in subdirectories of the 'upload' directory. For example, I would have expected to see the stylesheet in
../assets/css/ etc.
but in fact I'm finding it in
../upload/assets/css/ etc.
In addition to assets, I am also finding Templates and images as subdirectories of 'upload'.
Do you know why this 'upload' directory was used?
I am considering two possible approaches.
(1) Make sure everything needed is in ../upload/ and remove the subdirectories that are directly in the root directory
(2) Edit the template to remove all references to ../upload/
Note that (2) appeals to me because the file structure will be simpler; but I wonder if the client has some sort of extension in her Dreamweaver that causes everything she ftp's to be put into the 'upload' directory.
Note that so far I have copied my cleaned up css file over to ../upload/assets/ as a short-term solution. But they want to be able to make changes to their template, and add new pages, on their own in future.
Thanks.
The likely problem is how she has her FTP remote settings specified. It appears that it now points to the upload folder rather than the web root. Or, it could be that her FTP user account is tied to the upload folder rather than the web root.

Symfony admin generator generated module has no style

I am using Symfony 1.31 for a brand new project. I have just created a module in the backend app, using the admin generator. To my suprise, it seems no theme ((At all) has been applied to the pages. As I mentioned before, this si abrand new project - I have not even modified the /app/backend/layout.php file yet.
I rember having a similar problem before - I dont remmber how I solved it (I think I had to run a task or copy some files over to the /web folder before the styles/images etc came into efect. Can anyone refresh my memory?
You might need to run the plugin:publish-assets command:
php symfony plugin:publish-assets
This will create symlinks to your plugins' web/ directory inside your project's web/, thus enabling access to sfDoctrinePlugin's (or propel depending what ORM you use) admin-gen styles.
Check your apache configuration and files permissions, and especially the alias to the /sf/ subdirectory. It seems that the .css file corresponding to sf_admin pages are not accessible. You can fix it by adding an Alias to your virtualhost configuration, or allowing symlinks.
(By the way, hint: check your html source, find out the .css url, and try to access it directly with your browser)

Resources