Commit 68ef9773 authored by Aral Balkan's avatar Aral Balkan
Browse files

Update readme and changelog; bump version

parent 3b21e147
......@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [16.5.0] - 2021-04-23
### Added
- Custom middleware. You can now add any piece of standard Express middleware to your server by defining them as modules in a `.middleware` directory in your project.
## [16.4.1] - 2021-04-17
### Fixed
......
......@@ -1257,6 +1257,22 @@ module.exports = function (client, request) {
}
```
### Custom Middleware
As of version 16.5.0, you can now add any piece of standard Express middleware to your server by defining them as modules in a `.middleware` directory in your project.
For example, to have your server allow all cross-origin requests, define the following middleware in `.middleware/allow-all-cors.js`:
```js
module.exports = (request, response, next) => {
response.header('Access-Control-Allow-Origin', '*')
response.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept')
next()
}
```
This gives you full flexibility in customising your server however you like.
### Persisting data on the server with JavaScript Database (JSDB)
The chat examples so far have been ephemeral; the chat log is not stored anywhere. While that has its uses, it does mean, for example, that someone coming into a conversation after it has already started will not see what was said. You can easily implement that feature using the bundled JavaScript Database (JSDB).
......
{
"name": "@small-tech/site.js",
"version": "16.4.1",
"version": "16.5.0",
"description": "Small Web construction set.",
"keywords": [
"web server",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment