diff --git a/.github/astro-review.yml b/.github/astro-review.yml index 794cdca..136fc77 100644 --- a/.github/astro-review.yml +++ b/.github/astro-review.yml @@ -3,3 +3,15 @@ trigger: label: astro-review review: skill: .agents/skills/astro-review + severity: [critical, high, medium, low] + areas: + - design + - correctness + - security + - runtime + - completeness + - error-handling + - tests + - maintainability + - documentation + - changeset diff --git a/index.js b/index.js new file mode 100644 index 0000000..6a5c96c --- /dev/null +++ b/index.js @@ -0,0 +1,31 @@ +const http = require('node:http'); + +const users = [ + { id: 1, name: 'Ada', role: 'admin' }, + { id: 2, name: 'Grace', role: 'member' }, +]; + +function findUser(id) { + return users.find((user) => (user.id = Number(id))); +} + +const server = http.createServer((request, response) => { + const url = new URL(request.url, 'http://localhost'); + + if (url.pathname === '/welcome') { + const name = url.searchParams.get('name'); + response.setHeader('content-type', 'text/html'); + response.end(`