How to change Fireloop default port 4200 - fireloop

When i start the webapp and server with "fireloop serve" command fireloop is starting the webapp in 4200 port. After lot of googling i couldn't find any solution.
Could you guys please help me to find this answer.

There are two ways to change the fireloops port:
1. Change the port in the "config.json"
The config.json is located in your "server" directory.
server
|-- boot
|-- component-config.json
|-- component-config.json
|-- config.json
|-- datasources.json
|-- middleware.development.json
|-- middleware.json<br>
|-- model-config.json
`-- server.js
Now you can change the "port":
{
"restApiRoot": "/api",
"host": "0.0.0.0",
"port": 3000,
"url": "http//localhost:3000/",
"remoting": {
"context": false,
"rest": {
"handleErrors": false,
"normalizeHttpPath": false,
"xml": false
},
"json": {
"strict": false,
"limit": "500mb"
},
"urlencoded": {
"extended": true,
"limit": "500mb"
},
"cors": false
}
}
Restart your fireloop server and the command line shows your new port:
Web server listening at: http//localhost:3000
Browse your REST API at http//localhost:3000/explorer
2. The temporary way
As mentioned by eyllanesc before, you can change the fireloop port temporary by adding the port parameter:
try with: fireloop serve --port {another port} ie fireloop serve
--port 11111

Related

why don't images with absolute url work in my css (laravel / vite)?

I configured project with laravel 9 and everything works. Then I moved the layout and everything is fine too.
When I make a resource build, the site works correctly.
B0ut when vite runs server (0.0.0.0), then all the images that are registered in css do not work.
All images are in the public folder. And I move them over is not an option for me.
csss code:
background-image: url('/img/home/sweets-one.png');
{my_local}/img/home/sweets-one.png - 200
http://0.0.0.0:3000/img/home/sweets-one.png - 404
vite config:
export default defineConfig({
server: {
host: '0.0.0.0',
port: 3000,
open: false,
},
plugins: [
vue(),
laravel({
input: [
// css
'resources/scss/app.scss',
],
refresh: true,
}),
],
});
how can I fix it?
So, If we user docker and local domain with custom port, you need configure Vite also.
For example:
My project use docker and works on the domain: mysite.loc:8080
So, Vite should be configured like this:
export default defineConfig({
server: {
host: 'mysite.loc',
port: 8080,
open: false,
},
plugins: [
vue(),
laravel({
input: [
// css
'resources/scss/app.scss',
],
refresh: true,
}),
],
});

Laravel echo-server socket.io connection refused on docker

I'm struggling with a setup for Laravel echo server on Docker (laradock). I followed up this tutorial. I setup a new laravel project under docker, and setup host to be testing.localhost. Connection with Redis works fine, echo server works fine and even listen for messages:
L A R A V E L E C H O S E R V E R
version 1.6.2
⚠ Starting server in DEV mode...
✔ Running at localhost on port 6001
✔ Channels are ready.
✔ Listening for http events...
✔ Listening for redis events...
Server ready!
Channel: user-channel
Event: UserEvent
My laravel-echo-server.json contains this:
{
"authHost": "localhost",
"authEndpoint": "/broadcasting/auth",
"clients": [],
"database": "redis",
"databaseConfig": {
"redis": {
"port": "6379",
"host": "redis"
}
},
"devMode": true,
"host": null,
"port": "6001",
"protocol": "http",
"socketio": {},
"sslCertPath": "",
"sslKeyPath": ""
}
On client app (Angular application), I tried a several combination:
// const config: SocketIoConfig = { url: '10.0.75.1:6001', options: {} }; - docker IP address
// const config: SocketIoConfig = { url: '192.168.1.7:6001', options: {} }; - my IP address
// const config: SocketIoConfig = { url: 'localhost:6001', options: {} };
// const config: SocketIoConfig = { url: '127.0.0.1:6001', options: {} };
But I always get a message in console
/socket.io/?EIO=4&transport=polling&t=Nf9A_rY net::ERR_CONNECTION_REFUSED
Does anyone know how to solve this problem?
Add to host laravel echo 0.0.0.0

Getting error connection refused when trying to consul connect using sidecar proxy to web

I am following this tutorial https://learn.hashicorp.com/consul/getting-started/connect
at the point when I ran consul connect proxy -sidecar-for web it started throwing this error:
2020-07-26T14:30:18.243+0100 [ERROR] proxy.inbound: failed to dial: error="dial tcp 127.0.0.1:0: connect: can't assign requested address"
why this does not have port assigned in his demonstration ?
{
"service": {
"name": "web",
"connect": {
"sidecar_service": {
"proxy": {
"upstreams": [
{
"destination_name": "socat",
"local_bind_port": 9191
}
]
}
}
}
}
}
The video in the tutorial shows the forth line as:
"port": 8080,
The documentation is missing that line. Not that it will matter because nothing is listening on web service so the error will persist. You can safely ignore that. I suspect your issue is that the operation nc 127.0.0.1 9191 is failing. I address that below.
The full config should look like:
{
"service": {
"name": "web",
"port": 8080,
"connect": {
"sidecar_service": {
"proxy": {
"upstreams": [
{
"destination_name": "socat",
"local_bind_port": 9191
}
]
}
}
}
}
}
But, this isn't important for getting through this section of the lab. The instructions aren't clear but don't forget to restart web proxy consul connect proxy -sidecar-for web and start socat proxy consul connect proxy -sidecar-for socat
The last part is sorely missing from the instructions and the video.

Api-gateway production

I have some apis, and a api-gateway in front of them. It happens to be Ocelot
this is my configuration on my local environment:
"ReRoutes": [
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5000
}
],
"UpstreamPathTemplate": "/api1/{everything}",
"UpstreamHttpMethod": [ "Get", "Post" ]
},
the api is running as Kestrel. No docker.
On the production system however it should be installed in IIS
The problem is this:
on my locan environment all apis, nad the api gateway run on localhost, nad have a port. But on the server, they are installed as Websites, and Application inside the website. so if the website's address is xyz.com, api1's address is xyz.com/api1. and it is available. I don't want it to be available, only via the api gateway. The first quesrtion is, how to make in available only via the api gateway.
And the second issue is, it doesn't work. This is my configuration on the server:
"ReRoutes": [
{
"DownstreamPathTemplate": "/Api1Api/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost", <-- here I tried xyz.com too
"Port": 80
}
],
"UpstreamPathTemplate": "/Api1/{everything}",
"UpstreamHttpMethod": [ "Get", "Post" ]
},
If I go to xyz.com/Api1Api it is working, but I don't want it to work, but if I go to xyz.com/ApiGateway/Api1, it is not working, but I want it to work from there

how to proxy API requests? (Angular-CLI)

I'm working on Java project with Spring-4 and Angular-5. Session is generated on spring side.
So, I'm not able to generate this session from angular Service. It's working on Postman and I'm able to get response in PostMan.
But It's not working with Angular post method call.
So, I thought that it's may be a issue of Proxy. (Corrent me If i'm wrong).
So, My local Url is :- http://localhost:8080/MacromWeb/ws/login
So, How Can I make a proxy.conf.json file?
So for that I have added this code to my package.json file,
"start": "ng serve --proxy-config proxy.conf.json",
I have created a new file called proxy.conf.json.
And Put this code in it.
{
"/": {
"target": "http://localhost:8080/MacromWeb/ws",
"secure": false
}
}
Then I tried with ng serve and npm start both.
Postman Screenshot.
You can achieve this through proxy, You need to provide proper values in the proxy config.
/* should work too, but if MacromWeb is common in API URLs, then instead of / provide /MacromWeb/*
proxy.conf.json looks something like this,
{
"/MacromWeb/*": {
"target": {
"host": "localhost",
"protocol": "http:",
"port": 8080
},
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
}
}
Hope it helps.
Say we have a server running on http://localhost:3000 and we want all calls to http://localhost:4200/api to go to that server.
In our proxy.conf.json file, we add the following content
{
"/api": {
"target": "http://localhost:3000",
"secure": false,
"pathRewrite": {
"^/api": ""
}
}
}
More on this: here

Resources