twolfson / vagrant-nodebugme

Vagrant for `nodebugme`

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vagrant-nodebugme

Vagrant for nodebugme

This was created to prevent postgres pollution on local machines.

Screenshot

Getting Started

vagrant-nodebugme was developed against Vagrant@1.4.1 but should be compatible with any 1.y.z. To get nodebugme running, follow the steps below:

# Clone the repository
git clone https://github.com/twolfson/vagrant-nodebugme
cd vagrant-node

# Provision Vagrant
vagrant up

# SSH into the machine and start the server
# For development, you can edit `site/` on the host machine
vagrant ssh
  # Inside of Vagrant context
  cd /vagrant/site/
  npm start
  # starting server on http://localhost:8080

Development

git

vagrant-nodebugme clones the entire nodebugme/site repo into a site/ in vagrant-nodebugme's directory. This is a fully funtional git repo that can check out branches, commit, and push.

psql

nodebugme/site uses PostgreSQL as its database. To debug database information, you can leverage the psql CLI tool. The database name will be nodebugme.

psql --db nodebugme
# nodebugme=#

If you are a first timer to psql, here are some quick gotchas/should knows:

  • Always use single quotes when referring to data
# Good
SELECT 'Hello World';
# Bad
SELECT "Hello World";
  • Results are not automatically sorted by index, leverage SORT BY to fix this.
# Sorting guaranteed
SELECT id FROM items SORT BY id;
# Sorting not guaranteed
SELECT id FROM items;
  • All psql commands are \{command}. The full list can be viewed via \?.
  • When viewing query results that wrap rows, try \x (9.2 introduces \x auto). It changes the output to an extended format.
# With \x
-[ RECORD 1 ]------------------------------------------------
----------------
first  | some reaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaly long text
second | more content
# Without \x
                                first
         |    second
-------------------------------------------------------------
---------+--------------
 some reaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaly l
ong text | more content
(1 row)

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

Donating

Support this project and others by twolfson via gratipay.

Support via Gratipay

Unlicense

As of Oct 31 2014, Todd Wolfson has released this repository and its contents to the public domain.

It has been released under the UNLICENSE.

About

Vagrant for `nodebugme`

License:The Unlicense


Languages

Language:Shell 100.0%