aboutsummaryrefslogtreecommitdiff
path: root/modules/httpd-config.el
blob: c90399425618a44a500f16a24fa304bbacaf3bac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;;; httpd-config --- Setup for a Simple HTTP Server -*- lexical-binding: t; coding: utf-8; -*-
;; author Craig Jennings <c@cjennings.net>

;;; Commentary:
;;
;; Layer: 4 (Optional).
;; Category: O/D/P.
;; Load shape: eager.
;; Eager reason: none; local web server, a command-loaded deferral candidate.
;; Top-level side effects: package configuration via use-package.
;; Runtime requires: none.
;; Direct test load: yes.
;;
;;; Code:


;;;; -------------------------- Simple-Httpd -------------------------

(use-package simple-httpd
  :defer 1
  :preface
  (defconst wwwdir (concat user-emacs-directory "www"))
  (defun check-or-create-wwwdir ()
    (unless (file-exists-p wwwdir)
      (make-directory wwwdir)))
  :init (check-or-create-wwwdir)
  :config
  (setq httpd-root wwwdir)
  (setq httpd-show-backtrace-when-error t)
  (setq httpd-serve-files t))


(provide 'httpd-config)
;;; httpd-config.el ends here