FOSJsRoutingBundle dump with baseurl - symfony-3.3

I use
php bin/console fos:js-routing:dump -e=prod --target="web/js/fos_js_routes.prod.js"
to dump all routes, but the problem is my production symfony not in root url.
I mean, it place in https://myshop.com/symfonyapp and all generated route dont have /symfonyapp
for example homepage to be / and what I expect is /symfonyapp/
how to set baseurl to dump all route?

You have to setup this variable in the config file:
// config/packages/fos_js_routing.yaml
fos_js_routing:
request_context_base_url: 'symfonyapp/'

Related

How can I set up a devserver proxy in Vue, but have it ignore local php files?

I have a devserver proxy setup in VueJS that allows me to talk to my website for APIS and get around CORS problems when working in my local devbuild.
However, with this setup, if the requested file exists locally, the local devserver proxy doesn't get the file from my website (which I want it to do for PHP files), it instead tries to load the local PHP file via the Vue devserver.
my vue.config.js file looks like this:
module.exports = {
"transpileDependencies": [
"vuetify"
],
devServer: {
proxy: 'https://www.example.com',
}
}
Is it possible to set up exclusions for specific files, or specific file types (ie PHP files)?

How to serve Vue application over HTTPS?

I am trying to serve Vue application over HTTPS instead of HTTP.
I have tried to add --https flag to webpack-dev-server and add https: true in build/webpack.dev.cong.js but when I try to open the app in the browser it crashes with the following error:
[DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
internal/buffer.js:945
class FastBuffer extends Uint8Array {}
^
RangeError: Invalid typed array length: -4095
at new Uint8Array (<anonymous>)
Is there something that I missed or what is the solution for this?
And if the HTTPS properly configured to webpack devServer, after building the project it would work the same when served with web server like nginx or I have to add some reverse proxying?
If you want to do this on your local machine, then you are going to want to use NGINX to serve up the HTTPS-traffic and use it to reverse proxy to whatever port on your local machine that you mount your webpack-dev-server. There might be a way to get Webpack to do this, but it wasn't designed to do this.

Processing paths that start with a dot using Mason dhandler

How can I make a Mason dhandler process a URL whose path section starts with .?
For example, if I have a dhandler file in my web root, the dhandler is triggered if I navigate to
`http://www.example.com/hello`
but I get a 404 if I navigate to http://www.example.com/.hello.
I am using Mason in combination with Apache and I have verified that this is not an Apache configuration issue forbidding paths that start with dot.
You're probably mean HTML::Mason and not the new(er) Mason.
While I haven't installed Apache, but it is simple to create an PSGI test-case using HTML::Mason::PSGIHandler, like such app.psgi
use 5.014;
use warnings;
use HTML::Mason::PSGIHandler;
my $h = HTML::Mason::PSGIHandler->new(
comp_root => $ENV{HOME}.'/tmp/mas/comps',
);
my $app = sub {
my $env = shift;
$h->handle_psgi($env);
};
and an very simple dhandler
<pre>
=<% $m->dhandler_arg %>=
</pre>
after running plackup and pointing my browser to http://localhost:5000/.hello it shows
so, the HTML::Mason hasn't any limitations on processing paths with dots.
If you need more help, edit your question and add relevant parts of your apache config, htaccess, and your handlers how do you invoke the HTML::Mason.

Express server issues for index.html, bundle.js, serving index.html for every router (b/c of react-router) and more

I have this:
let dir = __dirname + "/dist"
app.use(express.static(dir));
I log out dir and see that the URL is indeed the same location I've compiled (via webpack) my bundle.js. yet if (in Postman) I run a GET for localhost:8080/dist/bundle.js I get a Cannot GET /dist/bundle.js response.

Jekyll post links not including base url

I've added my baseurl to the config for Jekyll, but every permalink is not appending it. I'm using Jekyll version 2.5.3 and Apache.
This is what the config looks like for all relevant content:
baseurl: /blog
host: 0.0.0.0
permalink: /:year/:month/:day/:title
destination: /var/www/html/blog/_site/
The directory structure is the way it should, but the link request all show localhost/2015/06...
Does the routing need to be adjusted by Jekyll or Apache?
You have to explicitly use site.baseurl. Jekyll doesn't automatically prepend it to urls.
<a href="{{site.baseurl}}{{post.url}">
I understand this question might be outdated, but I also ran into this issue while hosting a Jekyll blog on GitHub pages.
You can use the relative_url Liquid Filter provided by Jekyll to automatically prepend any url with the baseurl configured in _config.yml.
Example:
{{ post.title }}
Relative URL
Prepend baseurl config value to the input to convert a URL path into a relative URL. This is recommended for a site that is hosted on a subpath of a domain.