slope.js is a web server library written in Node.js that strives to be as feature-filled as it is easy-to-use.
Used as a parameter for function calls.
Used internally as an object to store configuration.
Class used internally as a list of headers.
Class passed as the second parameter to route callbacks.
Object used internally as a list of routes.
The object used to create a web server.
Used as a parameter for function calls.
Used internally as an object to store configuration.
Class used internally as a list of headers.
Kind: global class
String
Retrieves a header from the object.
Kind: static method of Header
Returns: String
- The value of the header.
Param | Type | Description |
---|---|---|
header | String |
The header’s name. |
Adds or replaces a header in the object.
Kind: static method of Header
Param | Type | Description |
---|---|---|
header | String |
The header’s name. |
value | String |
The value the header will be set to. |
Removes a header from the object.
Kind: static method of Header
Param | Type | Description |
---|---|---|
header | String |
The header’s name. |
Class passed as the second parameter to route callbacks.
Kind: global class
Sends text with provided headers and ends the response.
Kind: static method of Result
Param | Type | Default | Description |
---|---|---|---|
content | String |
Content to write/return. | |
[headers] | Object |
{"Content-Type": "text/html"} |
Headers to send. |
Sends text WITHOUT headers and DOES NOT end the response.
Kind: static method of Result
Param | Type | Description |
---|---|---|
content | String |
Content to write. |
Ends the response (with an optional message).
Kind: static method of Result
Param | Type | Default | Description |
---|---|---|---|
[content] | String |
"" |
Content to write/return. |
Sets status and headers.
Kind: static method of Result
Param | Type | Default | Description |
---|---|---|---|
status | Number |
Status code to return. | |
[headers] | Object |
{"Content-Type": "text/html"} |
Headers to send. |
Object used internally as a list of routes.
Kind: global class
Assigns a function to a URL.
Kind: static method of Routes
Param | Type | Description |
---|---|---|
name | String | RegExp |
The URL/RegExp to bind the function to, or “*” as a fallback. |
callback | function |
What to call when the page is visited. |
Removes a URL from the database of routes.
Kind: static method of Routes
Param | Type | Description |
---|---|---|
name | String | RegExp |
The URL to remove from the database. |
The object used to create a web server.
Run the web server.
Kind: static method of Server