https://github.com/jaemk/blank
https://github.com/jaemk/blank
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jaemk/blank
- Owner: jaemk
- License: epl-1.0
- Created: 2021-09-27T02:49:09.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-27T02:49:48.000Z (over 3 years ago)
- Last Synced: 2025-01-20T00:47:51.862Z (4 months ago)
- Language: Clojure
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# blank
> blank clojure webserver project
## Build/Installation
```
# generate a standalone jar wrapped in an executable script
$ lein bin
```## Database
[`migratus`](https://github.com/yogthos/migratus) is used for migration management.
```
# create db
$ sudo -u postgres psql -c "create database blank"# create user
$ sudo -u postgres psql -c "create user blank"# set password
$ sudo -u postgres psql -c "alter user blank with password 'blank'"# allow user to create schemas in database
$ sudo -u postgres psql -c "grant create on database blank to blank"# allow user to create new databases
$ sudo -u postgres psql -c "alter role blank createdb"# apply migrations from repl
$ lein with-profile +dev repl
user=> (cmd/migrate!)# running the app from "main" will also apply migrations
# lein run
```## Usage
```
# start the server
$ export PORT=3003 # default
$ export REPL_PORT=3999 # default
$ bin/blank# connect to running application
$ lein repl :connect 3999
user=> (initenv) ; loads a bunch of namespaes
user=> (cmd/migrate!)
```## Testing
```
# run test
$ lein midje# or interactively in the repl
$ lein with-profile +dev repl
user=> (autotest)
```## Docker
```
# build
$ docker build -t blank:latest .
# run
$ docker run --rm -p 3003:3003 -p 3999:3999 --env-file .env blank:latest bin/blank
```## License
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.