Skip to content

Commit

Permalink
upgrade greenwood 0.28.2 (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 authored May 6, 2023
1 parent 851525d commit 17ad34b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"netlify": "netlify dev"
},
"devDependencies": {
"@greenwood/cli": "^0.28.1",
"@greenwood/cli": "^0.28.2",
"netlify-cli": "^13.2.2",
"rimraf": "^5.0.0"
}
Expand Down
6 changes: 4 additions & 2 deletions src/api/greeting.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export async function handler(request) { // <-- new Request
import { getMessage } from '../services/message.js';

export async function handler(request) {
const params = new URLSearchParams(request.url.slice(request.url.indexOf('?')));
const name = params.has('name') ? params.get('name') : 'Greenwood';
const body = { message: `Hello ${name}!!!` };
const body = { message: getMessage(name) };
const headers = new Headers();

headers.append('Content-Type', 'application/json');
Expand Down
7 changes: 7 additions & 0 deletions src/services/message.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function getMessage(name) {
return `Hello ${name}!`;
}

export {
getMessage
}

0 comments on commit 17ad34b

Please sign in to comment.