Everything you need to get you up and running with a compojure-api utilizing token-based authentication.
Make sure you have the latest version of leiningen installed.
lein new authenticated-compojure-api <project-name>
The project pulls sensitive information from environment variables. Make sure to populate the file completely.
Equivalent environment variables are DATABASE_URL
, USER_EMAIL
, USER_PASS_KEY
, AUTH_KEY
.
psql < script/init_database.sql
Migrations are managed by migratus to begin working initially run both:
lein migratus migrate && lein with-profile test migratus migrate
lein run -m <project-name>.server 3000
curl 'http://localhost:3000/api/v1/user' -X POST -H 'Content-Type: application/json' -d '{"email":"some@one.com","username":"someone","password":"somePassword1"}'
lein test
The HTML documentation can be generated with lein doc
the output will be
saved in doc/api
.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close