Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
foundation1-gcp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Syed Bilal Raees
foundation1-gcp
Commits
ca962a48
Commit
ca962a48
authored
Jan 02, 2023
by
Muneeb Saeed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Google authentication added.
parent
f76cd13f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
9 deletions
+5
-9
App.js
nodejs-retail/App.js
+0
-2
client_secret_850146903364-offnkcq2ac73ugqlmi7vohoc1rjci312.apps.googleusercontent.com.json
...2ac73ugqlmi7vohoc1rjci312.apps.googleusercontent.com.json
+1
-0
package.json
nodejs-retail/package.json
+2
-1
search-simple-query-copy.js
.../interactive-tutorials/search/search-simple-query-copy.js
+0
-0
search.js
ulta-beauty/src/components/search.js
+2
-6
No files found.
nodejs-retail/App.js
View file @
ca962a48
...
...
@@ -8,13 +8,11 @@ app.options('*', cors());
const
bodyParser
=
require
(
'body-parser'
)
app
.
use
(
bodyParser
.
json
());
console
.
log
(
'App Running...'
)
const
searchService
=
require
(
'./samples/interactive-tutorials/search/search-simple-query'
);
app
.
get
(
'/search'
,
(
req
,
res
)
=>
{
searchService
(
req
.
query
.
text
)
.
then
(
result
=>
{
// console.log('Resultss', result);
return
res
.
send
(
result
);
})
.
catch
(
err
=>
res
.
send
(
err
))
...
...
nodejs-retail/client_secret_850146903364-offnkcq2ac73ugqlmi7vohoc1rjci312.apps.googleusercontent.com.json
0 → 100644
View file @
ca962a48
{
"web"
:{
"client_id"
:
"850146903364-offnkcq2ac73ugqlmi7vohoc1rjci312.apps.googleusercontent.com"
,
"project_id"
:
"abs-poc-np-prj-01-3f2a"
,
"auth_uri"
:
"https://accounts.google.com/o/oauth2/auth"
,
"token_uri"
:
"https://oauth2.googleapis.com/token"
,
"auth_provider_x509_cert_url"
:
"https://www.googleapis.com/oauth2/v1/certs"
,
"client_secret"
:
"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"
,
"redirect_uris"
:[
"https://3001-cs-e60cf927-fc0f-43c2-b5ee-d4e6f9493653.cs-asia-southeast1-bool.cloudshell.dev/search"
,
"https://3002-cs-e60cf927-fc0f-43c2-b5ee-d4e6f9493653.cs-asia-southeast1-bool.cloudshell.dev/https://3001-cs-e60cf927-fc0f-43c2-b5ee-d4e6f9493653.cs-asia-southeast1-bool.cloudshell.dev/search"
],
"javascript_origins"
:[
"https://3001-cs-e60cf927-fc0f-43c2-b5ee-d4e6f9493653.cs-asia-southeast1-bool.cloudshell.dev"
,
"https://3002-cs-e60cf927-fc0f-43c2-b5ee-d4e6f9493653.cs-asia-southeast1-bool.cloudshell.dev"
]}}
\ No newline at end of file
nodejs-retail/package.json
View file @
ca962a48
...
...
@@ -3,6 +3,7 @@
"version"
:
"1.0.0"
,
"main"
:
"App.js"
,
"dependencies"
:
{
"@google-cloud/retail"
:
"^2.3.0"
,
"body-parser"
:
"^1.20.1"
,
"cors"
:
"^2.8.5"
,
"express"
:
"^4.18.2"
,
...
...
@@ -10,7 +11,7 @@
"nodemon"
:
"^2.0.20"
},
"scripts"
:
{
"dev"
:
"nodemon App.js"
,
"dev"
:
"
set GOOGLE_APPLICATION_CREDENTIALS=credentials.json &&
nodemon App.js"
,
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"author"
:
""
,
...
...
nodejs-retail/samples/interactive-tutorials/search/search-simple-query
copy.js
→
nodejs-retail/samples/interactive-tutorials/search/search-simple-query
-
copy.js
View file @
ca962a48
File moved
ulta-beauty/src/components/search.js
View file @
ca962a48
import
React
,
{
useState
}
from
'react'
;
import
SearchResults
from
'./search-results'
;
// import { CONFIGS } from '../client-config';
// import mockResponse from '../mock-response.json'
import
{
Button
,
Input
,
Col
,
Row
}
from
'antd'
;
import
{
SearchOutlined
}
from
'@ant-design/icons'
;
...
...
@@ -21,11 +19,9 @@ const Search = () => {
const
handleOnSearch
=
async
(
value
)
=>
{
const
{
text
}
=
value
;
if
(
text
)
{
// const searchResults = mockResponse;
const
searchResults
=
await
fetch
(
`http://localhost:3002/search?text=
${
text
}
`
)
// .then(res => res.json())
.
then
(
res
=>
res
.
data
);
// console.log('searchResults', searchResults);
.
then
(
res
=>
res
.
json
())
.
catch
(
err
=>
console
.
log
(
err
));
setSearchResults
(
searchResults
.
results
.
length
?
[...
searchResults
.
results
]
:
[]);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment