https://github.com/jenbuzz/express-simple-sitemap
:world_map: The simplest way to add a sitemap to an express application
https://github.com/jenbuzz/express-simple-sitemap
express express-middleware expressjs sitemap sitemap-generator sitemap-xml
Last synced: 8 months ago
JSON representation
:world_map: The simplest way to add a sitemap to an express application
- Host: GitHub
- URL: https://github.com/jenbuzz/express-simple-sitemap
- Owner: jenbuzz
- Archived: true
- Created: 2018-12-08T16:34:44.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-08T11:15:20.000Z (about 6 years ago)
- Last Synced: 2025-01-18T10:12:13.268Z (over 1 year ago)
- Topics: express, express-middleware, expressjs, sitemap, sitemap-generator, sitemap-xml
- Language: JavaScript
- Homepage:
- Size: 199 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](http://travis-ci.org/jenbuzz/express-simple-sitemap) [](https://coveralls.io/github/jenbuzz/express-simple-sitemap?branch=master)
# express-simple-sitemap
The simplest way to add a sitemap to an express application.
## Installation
```bash
$ npm install express-simple-sitemap
```
or
```bash
$ yarn add express-simple-sitemap
```
## Usage
```javascript
// express setup
const express = require('express');
const app = express();
// import express-simple-sitemap
const sitemap = require('express-simple-sitemap');
// add express-simple-sitemap as middleware
app.use(sitemap({
sitemapUrl: '/sitemap.xml', // optional, default value is '/sitemap.xml'
urls: [
{
url: 'https://github.com/jenbuzz',
lastmod: '2018-12-08', // optional
changefreq: 'daily', // optional
priority: 1.0, // optional
},
{
url: 'https://github.com/jenbuzz/express-simple-sitemap',
},
]
}));
```
Output:
```xml
https://github.com/jenbuzz
2018-12-08
daily
1
https://github.com/jenbuzz/express-simple-sitemap
```
## License
This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)