mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 20:55:21 +00:00
Add support for vercel search
This commit is contained in:
parent
44a7af447c
commit
f537472f5d
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ src/site/styles/_theme.*.css
|
|||||||
.netlify
|
.netlify
|
||||||
.idea/
|
.idea/
|
||||||
.vercel
|
.vercel
|
||||||
|
**/.DS_Store
|
||||||
|
11
api/search.js
Normal file
11
api/search.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
//vercel search function
|
||||||
|
const searchHandler = require('../netlify/functions/search/search.js').handler;
|
||||||
|
async function vercelSearch(request, response) {
|
||||||
|
let event = {queryStringParameters: request.query};
|
||||||
|
|
||||||
|
let searchResponse = await searchHandler(event);
|
||||||
|
|
||||||
|
return response.status(200).json(JSON.parse(searchResponse.body));
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.default = vercelSearch;
|
@ -49,6 +49,7 @@
|
|||||||
"src/helpers/utils.js",
|
"src/helpers/utils.js",
|
||||||
"src/helpers/linkUtils.js",
|
"src/helpers/linkUtils.js",
|
||||||
"netlify/functions/search/search.js",
|
"netlify/functions/search/search.js",
|
||||||
"src/site/get-theme.js"
|
"src/site/get-theme.js",
|
||||||
|
"api/search.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -2,6 +2,7 @@
|
|||||||
"outputDirectory": "dist",
|
"outputDirectory": "dist",
|
||||||
"installCommand": "npm install",
|
"installCommand": "npm install",
|
||||||
"buildCommand": "npm run build",
|
"buildCommand": "npm run build",
|
||||||
|
"devCommand": "npm run start",
|
||||||
"routes": [
|
"routes": [
|
||||||
{ "handle": "filesystem" },
|
{ "handle": "filesystem" },
|
||||||
{ "src": "/(.*)", "status": 404, "dest": "/404" }
|
{ "src": "/(.*)", "status": 404, "dest": "/404" }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user