11 lines
322 B
TypeScript
11 lines
322 B
TypeScript
import app from "../index";
|
|
|
|
const request = new Request("http://localhost/protected", {
|
|
headers: {
|
|
Authorization: "Basic " + Buffer.from("admin:password12").toString("base64"),
|
|
},
|
|
});
|
|
|
|
const response = await app.fetch(request);
|
|
console.log(await response.text()); // Should print "You are authenticated!"
|