All Projects → jweslley → bam

jweslley / bam

Licence: MIT license
A web server for developers

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects
CSS
56736 projects
Makefile
30231 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to bam

Site Webdev
Source for webdev.dartlang.org
Stars: ✭ 76 (+245.45%)
Mutual labels:  webdev
Resources
This repo is a one stop destination to find resources for learning various domains. You can find the roadmap for any domain here.
Stars: ✭ 198 (+800%)
Mutual labels:  webdev
bookmarks
Bookmarks that I ❤️
Stars: ✭ 151 (+586.36%)
Mutual labels:  webdev
Awoo
Awoo is a textboard engine based on the Sinatra micro-framework
Stars: ✭ 92 (+318.18%)
Mutual labels:  webdev
Web Development Articles
Monthly Series - Top 10 Web Development Articles
Stars: ✭ 143 (+550%)
Mutual labels:  webdev
Gowebexamples
Go Web Examples Generator
Stars: ✭ 252 (+1045.45%)
Mutual labels:  webdev
Cookbook Of Webdev
这是一份 web 开发者健康成长所需要的能力(偏前端)
Stars: ✭ 55 (+150%)
Mutual labels:  webdev
web-dev-blog
Мой блог на русском
Stars: ✭ 99 (+350%)
Mutual labels:  webdev
Meli
Platform for deploying static sites and frontend applications easily. Automatic SSL, deploy previews, reverse proxy, and more.
Stars: ✭ 2,125 (+9559.09%)
Mutual labels:  webdev
access
Access - Access is a initiative started by a bunch of professionals from various disciplines (engineering/education/finance) with only one goal- "Make technology education accessible in rural areas of India". This repo contains the content related to access bootcamp.
Stars: ✭ 38 (+72.73%)
Mutual labels:  webdev
Guide Integrateur
Un guide destiné aux intégrateurs chargés de réaliser des gabarits HTML et CSS accessibles.
Stars: ✭ 125 (+468.18%)
Mutual labels:  webdev
Duckrails
Development tool to mock API endpoints quickly and easily (docker image available)
Stars: ✭ 1,690 (+7581.82%)
Mutual labels:  webdev
Projects-Archive
This hacktober fest, the only stop you’ll need to make for ML, Web Dev and App Dev - see you there!
Stars: ✭ 21 (-4.55%)
Mutual labels:  webdev
Cdnjs
🤖 CDN assets - The #1 free and open source CDN built to make life easier for developers.
Stars: ✭ 9,270 (+42036.36%)
Mutual labels:  webdev
awesome-javascript-podcasts
JS, webdev, programming and life 🎧
Stars: ✭ 14 (-36.36%)
Mutual labels:  webdev
Jakarta.ee
Jakarta EE is the future of cloud native Java. Jakarta EE open source software drives cloud native innovation, modernizes enterprise applications and protects investments in Java EE.
Stars: ✭ 75 (+240.91%)
Mutual labels:  webdev
Web Dev Feeds
A collection of over 900 RSS feeds for web developers, updated monthly
Stars: ✭ 212 (+863.64%)
Mutual labels:  webdev
object-gui
Object GUI - Javascript Object GUI Editor
Stars: ✭ 51 (+131.82%)
Mutual labels:  webdev
jakartaone.org
JakartaOne Live is a one day virtual conference for developers and technical business leaders that brings insights into the current state and future of Jakarta EE and related technologies focused on developing cloud-native Java applications.
Stars: ✭ 13 (-40.91%)
Mutual labels:  webdev
Web-dev-mini-projects
The repository contains the list of awesome✨ & cool web development beginner-friendly✌️ projects!
Stars: ✭ 291 (+1222.73%)
Mutual labels:  webdev

BAM!

Travis

BAM! is a web-server for developers.

Heavily inspired by pow, BAM! goes further by supporting not only ruby/rack applications, but any Procfile-based application. Also, BAM! is planned to support both Linux and Mac OS X.

Installing

Download and put the binary somewhere in your path.

Building from source

git clone http://github.com/jweslley/bam
make build

How it works

BAM! is composed by a reverse-proxy and an application manager. On startup, the application manager search for Procfile-based applications in a given directory (customized by configuration file) and list all applications found at address http://bam.dev . From this listing, the user can start/stop applications.

However, in order to work properly, BAM! requires a couple of firewall rules and some tricks to resolve domain names. Thus, when the user access some application, like http://myblog.dev, the host OS must be configured to resolve any request to the top-level-domain .dev to localhost. After reaching port 80, the firewall must forward the request to reverse-proxy's port (defaults to 42042). Once a request reach the proxy, it will be forwarded to the target application (myblog in this example).

Since BAM! manages start/stop of the applications, it's important the web process in the Procfile be declared with a PORT environment variable, which will be informed by BAM! during application's startup. Something like:

web: rails server -p $PORT

Please checkout the examples directory.

The applications's directory, the top-level domain and proxy's port can be customized by configuration file.

Features

Application management

In BAM's terminology, an application is a directory in the applications's directory containing either a Procfile or a index.html file. Primarily, BAM! deals with Procfile-based applications (a directory with a Procfile). However, if a directory contains a index.html file, BAM! will serve all files inside this directory as an static server.

During application's start, BAM! will pick an unused port and start either a couple of external processes depending on Procfile or a static web server. The application will be accessible at the address: http://<application-name>.dev For example, the myblog application will be accessible at http://myblog.dev

Subdomains

Once a application is started, it's also automatically accessible from all subdomains.

Port aliases

BAM! lets you access others applications running in your machine using better names. For example, I like to use btsync to synchronize files between my computers, by default btsync start at system's boot at port 8888, using port aliases I can access btsync by typing http://btsync.dev instead of http://localhost:8888, it's easier to remember.

Accessing your applications from other computers

Sometimes you need to access your applications from another computer on your local network, but the .dev domain will only work on your local computer. In this case, you can use the special .xip.io domain to remotely access your applications.

192.168.1.15 is my current IP address in the local network!

Sharing applications to the Internet

xip.io is great, but works only on your local network. Nowadays, remote work is common and to show your application to a remote coworker or even a client your need to configure a VPS containing a configured environment. To simplify this task, BAM! lets you share/unshare your application to the Internet through localtunnel.

Storing config in the environment

During application's start, BAM! will loads .env file (if available) in the application's directory and pass all environment variables to the applications's processes.

Command center

The command center is the application manager. A web application accessible at http://bam.dev from where you will list, start, stop, share and unshare your applications.

Configuring BAM!

As stated before, BAM! requires a couple of firewall rules and some tricks to resolve domain names. Both of these requirements vary depending on your machine's operating system. Currently I tested BAM! in Archlinux (my beloved OS), but it should work in other Linux distributions too. Mac OSX support also must work, but not tested, configuration procedures were stolen from Pow. Feedback is welcome! ^^

Linux

First at all, we need a way to resolve domain names in top-level domain .dev to localhost. In Linux, we could run a custom DNS server (like localdns) for accomplish this, but there is a better way than running an extra process. For this, we will use localtld, a custom NSSwitch plugin to resolve domains for local applications. It's very straightforward to install, thus visit the project page and follow installation's instructions.

Since your machine is already resolving domain names to localhost, now we need forward all incoming connections from port 80 to BAM's reverse-proxy (port 42042). In Linux, the easier way is using iptables. BAM has a command to generate the iptables rules required. Thus, run the following commands:

bam -generate iptables > iptables.rules
sudo iptables-restore < iptables.rules

Depending your Linux distribution, you will need extra configuration to load these rules at system's boot.

It's done. Now, start BAM! and have fun.

MAC OS X

In Mac OSX, we need localdns to resolve domain names in top-level domain .dev to localhost. Thus, visit the project page and follow installation's instructions.

Since your machine is already resolving domain names to localhost, now we need forward all incoming connections from port 80 to BAM's reverse-proxy (port 42042). In Mac OSX, we will use plist to setup the firewall rules for us. BAM has a command to generate the plist file. Thus, run the following commands:

bam -generate firewall > bam.firewall.plist
sudo cp bam.firewall.plist /Library/LaunchDaemons/bam.firewall.plist
sudo launchctl bootstrap system /Library/LaunchDaemons/bam.firewall.plist 2>/dev/null
sudo launchctl enable system/bam.firewall 2>/dev/null
sudo launchctl kickstart -k system/bam.firewall 2>/dev/null

It's done. Now, start BAM! and have fun.

Windows

Yeah, Windows! Why not?! Theorically, with some windows expertise, is possible to configure both a DNS server to resolve top-level domain to localhost and the required firewall rules. I tried to configure localdns as a secondary DNS on Windows, but I discovered that the Windows DNS's client does not query the secondary DNS before a 15 minute timeout. :(

If you are experienced in Windows and want to help us, please take a look this issue.

Running BAM!

After download and put the binary somewhere in your path. Lets run BAM!, for this go to the directory containing your applications and execute it:

cd /path/to/my/apps
bam

It's it! By default, BAM! will look for applications in the current directory. To change this or some other configuration generate a configuration file and customize it.

bam -generate config > ~/.bam.conf

After edit the configuration file, run BAM! using it:

bam -config ~/.bam.conf

Upcoming features

Please take a look at issues tracker for upcoming features.

Bugs and Feedback

If you discover any bugs or have some idea, feel free to create an issue on GitHub:

http://github.com/jweslley/bam/issues

License

MIT license. Copyright (c) 2013-2015 Jonhnny Weslley http://jonhnnyweslley.net

See the LICENSE file provided with the source distribution for full details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].