factor-work/bonerbonerboner/services/services.factor

21 lines
552 B
Factor
Raw Normal View History

2021-04-04 11:10:32 -04:00
! Copyright (C) 2020 .
! See http://factorcode.org/license.txt for BSD license.
2021-04-11 23:04:12 -04:00
USING: kernel fry db db.sqlite environment math.parser io.pathnames ;
2021-04-04 11:10:32 -04:00
IN: bonerbonerboner.services
CONSTANT: bbb-default-port 8069
2021-04-11 23:04:12 -04:00
: bbb-data-directory ( -- path )
home ".bonerbonerboner" append-path ;
: <bbb-sqlite-db> ( -- db )
bbb-data-directory "bbb.db" append-path <sqlite-db> ;
2021-04-04 11:10:32 -04:00
: with-bbb-db ( quot -- )
2021-04-11 23:04:12 -04:00
'[ <bbb-sqlite-db> _ with-db ] call ; inline
2021-04-04 11:10:32 -04:00
: bbb-api-port ( -- port )
"BBB_API_PORT" os-env [ string>number ] [ bbb-default-port ] if* ;