-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to start fastboot server with unix socket #46
Comments
Hey @max-konin, were you able to get this working? The express docs state that you can put a path to a unix socket as the port argument.
|
@jeffjewiss No. I started using docker) |
@jeffjewiss Do you have a working example how of serving Fastboot via a socket? I'm currently using Nginx on port 8001:
// fastboot-server.js
/*eslint-env node*/
const FastBootAppServer = require('fastboot-app-server');
let server = new FastBootAppServer({
distPath: 'dist',
gzip: true,
host: '127.0.0.1',
port: 8001
});
server.start(); # /etc/nginx/sites-available/foo.com
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name foo.com;
location / {
proxy_pass http://127.0.0.1:8001;
}
} |
@janwerkhoven I don't think you should need to use a socket for just running Fastboot behind Nginx like that. However, if you do, you should be able to use the socket path in place of the port in your let server = new FastBootAppServer({
distPath: 'dist',
gzip: true,
host: '127.0.0.1',
port: '/tmp/express.sock'
}); |
Thanks! I've much grown to appreciate how Rails' Puma app server organises sockets:
With
Even without
To stop Fastboot, I've often had to resort to looking up the pid of the process that was listening to port 8000 and then kill it.
Surely there is an easier way? 😅 Also on my server port 8000 and 8001 are already taken by 2 other Fastboot app servers, thus I chose 8002 for this project. Not a big issue, though if these were sockets, each Fastboot app would not need care about the other apps listening on the same server. Instead their sockets would be neatly organised in their respective project folders:
Easy to kill. Inherits directory permissions. |
There is way to start fastboot r with unix socket? I have many ember apps on one server. And I have no wish to set up different port for each app.
The text was updated successfully, but these errors were encountered: