- You have node.js >= 4.2 installed
- You have rethinkdb installed and running
2.3.0, there are a couple of options to run bkmrkd. You can run it with one of the npm scripts, programmatically, or as a global command.
There are npm scripts for development, staging, and production. This is the only one that doesn't work if you're using this from npm.
# install the required modulesnpm install# if you want to run locallynpm start# for testing daemonized with pm2npm run stagenpm run stage:restartnpm run stage:stop# for production daemonized with pm2# unless you put your SSL certs in the `ssl` directory# you'll want to provide the path with an env variableBKMRKD_CONFIG_PATH=/path/to/config/file npm run prodBKMRKD_CONFIG_PATH=/path/to/config/file npm run prod:restartnpm run prod:stop
If you'd like to mount bkmrkd inside another app/node script, this is totally do-able too. The module exports both the express app and the SPDY server.
It's important to note here, however, that if you want to use the SPDY server bundled, you need to either move your certs into
./ssl/server.key. You can also specify the path to your config (relative to your cwd) by setting the
BKMRKD_CONFIG_PATH environment variable.
const bkmrkdApp = appconst bkmrkdServer = server// mount the app as you willapp// run the server with some other logic around itbkmrkdServer
Upon installation, npm will symlink a bkmrkd binary into a folder in your path. The command is
bkmrkd, and there are a few options you can provide.
Usage:bkmrkd [options]Options:--daemon, -d Daemonize the bkmrkd process with pm2--config, -c The path to your config file
Simply drag the bookmarklet to your bookmarks bar and click it on a webpage you want to save. Simple.
running in a production environment
So you want to run this for real. On the web. That's awesome. Everyone will want this to be setup differently, but this is how I've approached it.
- Proxy through nginx. Listen on port 80 for a domain/subdomain and proxy_pass to the app running on port 3000.
- Use SSL certs to avoid a new window opening when bookmarking things.
- Use a variety of startup scripts and backup scripts.
To work on bkmrkd locally, you'll want to start the node server and run gulp.
# make sure rethinkdb is runningrethinkdb --daemon# start the server in development modenpm start# in another window or tab, start gulp and watch for file changesgulp
migrating from 1.0 to 2.0
I don't think there are enough instances of bkmrkd (plus it didn't work that well) to warrant an upgrade guide. If you want one though, let me know and I'll create a guide. You can also check out migrating from mongodb to rethinkdb.
Please make a pull request! bkmrkd follows the js standard styleguide.