FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
workerd/samples/nodejs-compat-crypto/config.capnp at main · Reality2byte/workerd · GitHub
Reality2byte
/
workerd
Public
forked from
cloudflare/workerd
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
workerd
/
samples
/
nodejs-compat-crypto
/
config.capnp
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (28 loc) · 1.66 KB
Breadcrumbs
workerd
/
samples
/
nodejs-compat-crypto
/
config.capnp
Copy path
File metadata and controls
35 lines (28 loc) · 1.66 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
Imports the base schema for workerd configuration files.
#
Refer to the comments in /src/workerd/server/workerd.capnp for more details.
using
Workerd =
import
"/workerd/workerd
.
capnp"
;
#
A constant of type Workerd.Config defines the top-level configuration for an
#
instance of the workerd runtime. A single config file can contain multiple
#
Workerd.Config definitions and must have at least one.
const
helloWorldExample
:Workerd.Config
= (
#
Every workerd instance consists of a set of named services. A worker, for instance,
#
is a type of service. Other types of services can include external servers, the
#
ability to talk to a network, or accessing a disk directory. Here we create a single
#
worker service. The configuration details for the worker are defined below.
services = [ (name =
"main"
, worker = .helloWorld) ],
#
Every configuration defines the one or more sockets on which the server will listene.
#
Here, we create a single socket that will listen on localhost port 8080, and will
#
dispatch to the "main" service that we defined above.
sockets = [ ( name =
"http"
, address =
"*:8080"
, http = (), service =
"main"
) ]
);
#
The definition of the actual helloWorld worker exposed using the "main" service.
#
In this example the worker is implemented as a single simple script (see worker.js).
#
The compatibilityDate is required. For more details on compatibility dates see:
#
https://developers.cloudflare.com/workers/platform/compatibility-dates/
const
helloWorld
:Workerd.Worker
= (
modules = [
(name =
"worker"
, esModule = embed
"worker
.
js"
)
],
compatibilityDate =
"2024-05-03"
,
compatibilityFlags = [
"nodejs_compat_v2"
,
"experimental"
]
);
Back
|
FazBrowse Home
|
New Git URL