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
ea3a31b1
Commit
ea3a31b1
authored
Jan 03, 2023
by
Muneeb Saeed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Server js added
parent
101437ec
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
41 deletions
+16
-41
api.yaml
nodejs-retail/api.yaml
+2
-0
package.json
nodejs-retail/package.json
+2
-2
server.js
nodejs-retail/server.js
+2
-1
app.yaml
ulta-beauty/app.yaml
+0
-37
client.yaml
ulta-beauty/client.yaml
+9
-0
search.js
ulta-beauty/src/components/search.js
+1
-1
No files found.
nodejs-retail/api.yaml
0 → 100644
View file @
ea3a31b1
runtime
:
nodejs14
service
:
api
\ No newline at end of file
nodejs-retail/package.json
View file @
ea3a31b1
{
{
"name"
:
"test-app"
,
"name"
:
"test-app"
,
"version"
:
"1.0.0"
,
"version"
:
"1.0.0"
,
"main"
:
"
App
.js"
,
"main"
:
"
server
.js"
,
"dependencies"
:
{
"dependencies"
:
{
"@google-cloud/retail"
:
"^2.3.0"
,
"@google-cloud/retail"
:
"^2.3.0"
,
"body-parser"
:
"^1.20.1"
,
"body-parser"
:
"^1.20.1"
,
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
"nodemon"
:
"^2.0.20"
"nodemon"
:
"^2.0.20"
},
},
"scripts"
:
{
"scripts"
:
{
"dev"
:
"set GOOGLE_APPLICATION_CREDENTIALS=credentials.json && nodemon
App
.js"
,
"dev"
:
"set GOOGLE_APPLICATION_CREDENTIALS=credentials.json && nodemon
server
.js"
,
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
},
"author"
:
""
,
"author"
:
""
,
...
...
nodejs-retail/
App
.js
→
nodejs-retail/
server
.js
View file @
ea3a31b1
...
@@ -21,4 +21,5 @@ app.get('/search', (req, res) => {
...
@@ -21,4 +21,5 @@ app.get('/search', (req, res) => {
.
catch
(
err
=>
res
.
send
(
err
))
.
catch
(
err
=>
res
.
send
(
err
))
});
});
app
.
listen
(
3002
);
const
PORT
=
process
.
env
.
PORT
||
8080
;
app
.
listen
(
PORT
);
\ No newline at end of file
ulta-beauty/app.yaml
deleted
100644 → 0
View file @
101437ec
#service: ulta-beauty-react
#
#runtime: nodejs16
#
#handlers:
# - url: /static
#
# static_dir: build/static
# - url: /(.*\.(json|ico|js|webp))$
#
# static_files: build/\1
#
# upload: build/.*\.(json|ico|js|webp)$
# - url: .*
#
# static_files: build/index.html
#
# upload: build/index.html
#
# - url: /public
# static_dir: public
#
# - url: /public/(.*\.(json|ico|js|webp))$
#
# static_files: public/\1
#
# upload: public/.*\.(json|ico|js|webp)$
#
runtime
:
nodejs14
handlers
:
-
url
:
/(.*\..+)$
static_files
:
build/\1
upload
:
build/(.*\..+)$
-
url
:
/.*
static_files
:
build/index.html
upload
:
build/index.html
nodejs-retail/app
.yaml
→
ulta-beauty/client
.yaml
View file @
ea3a31b1
runtime
:
nodejs14
runtime
:
nodejs14
service
:
default
handlers
:
handlers
:
-
url
:
/(.*\..+)$
-
url
:
/(.*\..+)$
static_files
:
./
static_files
:
build/\1
upload
:
./
upload
:
build/(.*\..+)$
-
url
:
/.*
-
url
:
/.*
static_files
:
build/index.html
static_files
:
build/index.html
upload
:
build/index.html
upload
:
build/index.html
ulta-beauty/src/components/search.js
View file @
ea3a31b1
...
@@ -20,7 +20,7 @@ const Search = () => {
...
@@ -20,7 +20,7 @@ const Search = () => {
const
handleOnSearch
=
async
(
value
)
=>
{
const
handleOnSearch
=
async
(
value
)
=>
{
const
{
text
,
facets
}
=
value
;
const
{
text
,
facets
}
=
value
;
if
(
text
)
{
if
(
text
)
{
const
url
=
`http
://localhost:3002
/search?text=
${
text
}${
facets
&&
facets
.
length
?
`&facets=
${
facets
}
`
:
''
}
`
;
const
url
=
`http
s://api-dot-abs-poc-np-prj-01-3f2a.uc.r.appspot.com
/search?text=
${
text
}${
facets
&&
facets
.
length
?
`&facets=
${
facets
}
`
:
''
}
`
;
const
searchResults
=
await
fetch
(
url
)
const
searchResults
=
await
fetch
(
url
)
.
then
(
res
=>
res
.
json
())
.
then
(
res
=>
res
.
json
())
.
catch
(
err
=>
console
.
log
(
err
));
.
catch
(
err
=>
console
.
log
(
err
));
...
...
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