<commit_before>![Alt text](/dowels.png?raw=true "logo")

[![codecov](https://codecov.io/gh/jaredreich/dowels/branch/master/graph/badge.svg)](https://codecov.io/gh/jaredreich/dowels)

dowels is a tiny but powerful javascript library that performs client-side routing, templating, and REST API communication to help you get your single-page web applications running in seconds without having to learn huge fancy frameworks like Angular, React, etc. Demo: https://jaredreich.com/projects/dowels

## Features
- Pure JavaScript (no dependencies)
- Tiny size (4kB minified)
- Easy and intuitive routing (Express style, supports parameters and wildcards)
- Simple and fast (caching) template rendering (Embedded JavaScript style)
- Handy HTTP request helpers

## Browser support
- IE 10+
- Firefox 4+
- Chrome 5+
- Safari 6+
- Opera 11.5+

## Installation
HTML:
```html
<body>
	...
	<script src="/path/to/dowels.js"></script>
</body>
```
npm:
```
npm install dowels
```
bower:
```
bower install dowels
```

## Important requirement: your server must allow a changing URL path
This means that your main application URL path (example.com/app) and any other subsequent URL paths (example.com/app/*) must always route to the main index.html file.

### How to achieve this:
#### Node.js & Express
```
app.use(express.static(__dirname + '/public'));
app.get(['/app', '/app/*'], function(req, res) {
	res.sendFile('index.html', { root: __dirname + '/public' });
});
```

#### Apache & .htaccess
```
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]<commit_msg>add cdn link to readme<commit_after>![Alt text](/dowels.png?raw=true "logo")

[![codecov](https://codecov.io/gh/jaredreich/dowels/branch/master/graph/badge.svg)](https://codecov.io/gh/jaredreich/dowels)

dowels is a tiny but powerful javascript library that performs client-side routing, templating, and REST API communication to help you get your single-page web applications running in seconds without having to learn huge fancy frameworks like Angular, React, etc. Demo: https://jaredreich.com/projects/dowels

## Features
- Pure JavaScript (no dependencies)
- Tiny size (4kB minified)
- Easy and intuitive routing (Express style, supports parameters and wildcards)
- Simple and fast (caching) template rendering (Embedded JavaScript style)
- Handy HTTP request helpers

## Browser support
- IE 10+
- Firefox 4+
- Chrome 5+
- Safari 6+
- Opera 11.5+

## Installation
HTML:
```html
<body>
	...
	<script src="https://unpkg.com/dowels"></script>
</body>
```
npm:
```
npm install dowels
```
bower:
```
bower install dowels
```

## Important requirement: your server must allow a changing URL path
This means that your main application URL path (example.com/app) and any other subsequent URL paths (example.com/app/*) must always route to the main index.html file.

### How to achieve this:
#### Node.js & Express
```
app.use(express.static(__dirname + '/public'));
app.get(['/app', '/app/*'], function(req, res) {
	res.sendFile('index.html', { root: __dirname + '/public' });
});
```

#### Apache & .htaccess
```
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
{'fraction_non_alphanumeric': 0.14322332585709707, 'fraction_numerical': 0.005767382249279077, 'mean_word_length': 4.666061705989111, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6752679', 'n_tokens_mistral': 1023, 'n_tokens_neox': 942, 'n_words': 327}