https://github.com/aalemayhu/isun
Check if a website is using Netlify
https://github.com/aalemayhu/isun
jamstack netlify
Last synced: 8 months ago
JSON representation
Check if a website is using Netlify
- Host: GitHub
- URL: https://github.com/aalemayhu/isun
- Owner: aalemayhu
- License: mit
- Archived: true
- Created: 2018-12-31T00:29:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-01T19:32:16.000Z (over 7 years ago)
- Last Synced: 2025-01-19T09:12:38.522Z (over 1 year ago)
- Topics: jamstack, netlify
- Language: JavaScript
- Size: 85 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 
[](https://travis-ci.org/scanf/isun) [](https://badge.fury.io/js/%40scanf%2Fisun)
Check if a website is using Netlify by reading the HTTP server header field.
## Installation
npm install --save @scanf/isun
## Usage as module
```js
const url = "https://jamstack.xdp.no/";
require("@scanf/isun").IsUsingNetlify(url, isun => {
assert.equal(true, isun);
});
```
## Usage as Lambda function on Netlify
[](https://app.netlify.com/start/deploy?repository=https://github.com/scanf/isun)
Assuming you have deployed on Netlify and your domain is `example.xyz`, the below should work:
```js
curl https://example.xyz/.netlify/functions/isun?url=https://google.com
```
The function expects you to set the query parameter `url` and be compliant with [RFC 3986](https://www.ietf.org/rfc/rfc3986.txt). Or simply put pass
a valid url and remember to include `https://` prefix :wink:
## LICENSE
The project uses a MIT license for all files unless otherwise specified.
The project logo was created using the awesome [logo-maker](https://logo-maker.egoist.sh/) from [egoist/logo-maker](https://github.com/egoist/logo-maker).