This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhttpd.yaml
61 lines (52 loc) · 1.55 KB
/
httpd.yaml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Template : Simple HTTP server
# Author : Nuno Aguiar
# How to run : ojob httpd.yaml (change /data for the folder you need)
# oPack dependencies: latest ojob-common;
init:
# The port where the http server will be available
port : &PORT 8080
# Where the pid file will be located
piddir: &PIDDIR httpd.pid
# What folder to expose
folder: &FOLDER .
ojob:
daemon: true
unique:
pidFile : *PIDDIR
killPrevious: false
include:
- oJobHTTPd.yaml
todo:
- name: HTTP Start Server
args:
port : *PORT
mapLibs: true
- name: Prepare my file browser
- name: Prepare default
#- name: Prepare my docs
###########################################################
# The code
jobs:
# Serves any file available in /data (canonical path)
- name: Prepare default
to : HTTP Service
args:
uri : /
port : *PORT
execURI : "return ow.server.httpd.replyFile(server, (isDef(global.init) ? global.init.folder : '/data'), '/', request.uri);"
exec: |
global.init = args.init;
# Provides a file browser
- name: Prepare my file browser
to : HTTP File Browse
args:
uri : /browse
port : *PORT
path : *FOLDER
## What to answer to requests to /docs
#- name: Prepare my docs
# to : HTTP Service
# args:
# uri : /docs
# port : *PORT
# execURI : "return ow.server.httpd.replyFileMD(server, '/data/docs', '/docs', request.uri);"