This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm run build && npm run start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Request, Response } from "express"; | |
import { GoogleGenerativeAI } from '@google/generative-ai'; | |
import dotenv from "dotenv"; | |
dotenv.config(); | |
// GoogleGenerativeAI required config | |
const configuration = new GoogleGenerativeAI(process.env.API_KEY); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install express body-parser @google/generative-ai dotenv @types/node @types/express @types/body-parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir gemini-nodejs | |
cd gemini-nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> curl --head https://www.hsts-header-enabled.com | |
HTTP/2 200 | |
strict-transport-security: max-age=15552000; preload | |
--- | |
$> nmap -p 443 --script http-security-headers hsts-header-enabled.com | |
.... | |
PORT STATE SERVICE | |
443/tcp open https |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> curl --head https://www.hsts-heade-enabled.com | |
HTTP/2 200 | |
strict-transport-security: max-age=15552000; preload | |
--- | |
$> nmap -p 443 --script http-security-headers hsts-heade-enabled.com | |
.... | |
PORT STATE SERVICE | |
443/tcp open https |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
$> curl --head https://www.not-hsts-header.com | |
HTTP/1.1 301 Moved Permanently | |
Content-length: 0 | |
--- | |
$> nmap -p 443 --script http-security-headers not-hsts-header.com | |
.... |