Toggle navigation
Toggle navigation
This project
Loading...
Sign in
HyeonJun Jeon
/
Extended-Calendar
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
HyeonJun Jeon
2022-06-01 03:00:33 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f348106f1c5bcfba32ed80cbc108f327a0ae61d8
f348106f
1 parent
91b6928b
[Implement] Express server
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
79 additions
and
8 deletions
package-lock.json
package.json
src/libs/E_Campus.js → server/libs/E_Campus.js
src/libs/E_Campus_loginTest.js → server/libs/E_Campus_loginTest.js
src/libs/E_Campus_login_getPeed.js → server/libs/E_Campus_login_getPeed.js
server/server.js
src/pages/Debug.js
package-lock.json
View file @
f348106
...
...
@@ -11,6 +11,7 @@
"@testing-library/jest-dom"
:
"^5.16.4"
,
"@testing-library/react"
:
"^13.2.0"
,
"@testing-library/user-event"
:
"^13.5.0"
,
"axios"
:
"^0.27.2"
,
"express"
:
"^4.18.1"
,
"localforage"
:
"^1.10.0"
,
"puppeteer"
:
"^14.1.1"
,
...
...
@@ -4534,6 +4535,28 @@
"node"
:
">=12"
}
},
"node_modules/axios"
:
{
"version"
:
"0.27.2"
,
"resolved"
:
"https://registry.npmjs.org/axios/-/axios-0.27.2.tgz"
,
"integrity"
:
"sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ=="
,
"dependencies"
:
{
"follow-redirects"
:
"^1.14.9"
,
"form-data"
:
"^4.0.0"
}
},
"node_modules/axios/node_modules/form-data"
:
{
"version"
:
"4.0.0"
,
"resolved"
:
"https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz"
,
"integrity"
:
"sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww=="
,
"dependencies"
:
{
"asynckit"
:
"^0.4.0"
,
"combined-stream"
:
"^1.0.8"
,
"mime-types"
:
"^2.1.12"
},
"engines"
:
{
"node"
:
">= 6"
}
},
"node_modules/axobject-query"
:
{
"version"
:
"2.2.0"
,
"resolved"
:
"https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz"
,
...
...
@@ -19801,6 +19824,27 @@
"resolved"
:
"https://registry.npmjs.org/axe-core/-/axe-core-4.4.2.tgz"
,
"integrity"
:
"sha512-LVAaGp/wkkgYJcjmHsoKx4juT1aQvJyPcW09MLCjVTh3V2cc6PnyempiLMNH5iMdfIX/zdbjUx2KDjMLCTdPeA=="
},
"axios"
:
{
"version"
:
"0.27.2"
,
"resolved"
:
"https://registry.npmjs.org/axios/-/axios-0.27.2.tgz"
,
"integrity"
:
"sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ=="
,
"requires"
:
{
"follow-redirects"
:
"^1.14.9"
,
"form-data"
:
"^4.0.0"
},
"dependencies"
:
{
"form-data"
:
{
"version"
:
"4.0.0"
,
"resolved"
:
"https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz"
,
"integrity"
:
"sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww=="
,
"requires"
:
{
"asynckit"
:
"^0.4.0"
,
"combined-stream"
:
"^1.0.8"
,
"mime-types"
:
"^2.1.12"
}
}
}
},
"axobject-query"
:
{
"version"
:
"2.2.0"
,
"resolved"
:
"https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz"
,
...
...
package.json
View file @
f348106
...
...
@@ -6,6 +6,7 @@
"@testing-library/jest-dom"
:
"^5.16.4"
,
"@testing-library/react"
:
"^13.2.0"
,
"@testing-library/user-event"
:
"^13.5.0"
,
"axios"
:
"^0.27.2"
,
"express"
:
"^4.18.1"
,
"localforage"
:
"^1.10.0"
,
"puppeteer"
:
"^14.1.1"
,
...
...
@@ -19,7 +20,8 @@
"start"
:
"react-scripts start"
,
"build"
:
"react-scripts build"
,
"test"
:
"react-scripts test"
,
"eject"
:
"react-scripts eject"
"eject"
:
"react-scripts eject"
,
"server"
:
"nodemon server/server.js"
},
"eslintConfig"
:
{
"extends"
:
[
...
...
@@ -38,5 +40,6 @@
"last 1 firefox version"
,
"last 1 safari version"
]
}
},
"type"
:
"module"
}
...
...
s
rc
/libs/E_Campus.js
→
s
erver
/libs/E_Campus.js
View file @
f348106
const
puppeteer
=
require
(
"puppeteer"
)
;
import
puppeteer
from
"puppeteer"
;
//use puppeteer
function
setTimeoutPromise
(
ms
)
{
...
...
@@ -110,6 +110,6 @@ try {
}
}
login
(
"2021105253"
,
"qtw@@04271"
);
//
login("2021105253", "qtw@@04271");
export
{
login
};
...
...
s
rc
/libs/E_Campus_loginTest.js
→
s
erver
/libs/E_Campus_loginTest.js
View file @
f348106
//The prototype
//
const puppeteer = require("puppeteer")
;
//
import puppeteer from "puppeteer"
;
// const crawler = async() => {
// try{
// const browser = await puppeteer.launch({headless: false, args:['--window-size=1920,1080']});
...
...
s
rc
/libs/E_Campus_login_getPeed.js
→
s
erver
/libs/E_Campus_login_getPeed.js
View file @
f348106
const
puppeteer
=
require
(
"puppeteer"
)
;
import
puppeteer
from
"puppeteer"
;
//use puppeteer
function
setTimeoutPromise
(
ms
)
{
...
...
@@ -110,4 +110,4 @@ try {
}
}
login
(
"2021105253"
,
"qtw@@04271"
);
\ No newline at end of file
// login("2021105253", "qtw@@04271");
\ No newline at end of file
...
...
server/server.js
0 → 100644
View file @
f348106
import
express
from
"express"
;
import
{
login
}
from
"./libs/E_Campus.js"
;
const
app
=
express
();
const
router
=
express
.
Router
();
router
.
get
(
"/"
,
(
req
,
res
)
=>
{
res
.
header
(
"Access-Control-Allow-Origin"
,
"http://localhost:3000"
);
res
.
send
({
test
:
"Hi"
});
console
.
log
(
"listened /"
);
});
app
.
use
(
"/"
,
router
);
login
(
"asdf"
,
"asdf!"
);
app
.
listen
(
3001
,
function
()
{
console
.
log
(
"listening on 3001"
);
});
src/pages/Debug.js
View file @
f348106
import
axios
from
"axios"
;
import
{
useState
}
from
"react"
;
import
{
useNavigate
}
from
"react-router-dom"
;
//import { login } from "../libs/E_Campus";
...
...
@@ -32,9 +33,13 @@ const Debug = () => {
case
"login"
:
//result = login(state.input1, state.input2);
break
;
case
"server"
:
axios
.
get
(
"http://localhost:3001/"
)
.
then
((
res
)
=>
setState
({
...
state
,
output
:
res
.
data
.
test
}));
return
;
default
:
}
console
.
log
(
result
);
setState
({
...
state
,
output
:
result
});
};
...
...
@@ -57,6 +62,7 @@ const Debug = () => {
<
select
name
=
"type"
value
=
{
state
.
type
}
onChange
=
{
handleChangeState
}
>
<
option
value
=
{
"initSubjects"
}
>
initSubjects
<
/option
>
<
option
value
=
{
"login"
}
>
login
<
/option
>
<
option
value
=
{
"server"
}
>
server
<
/option
>
<
/select
>
<
/div
>
...
...
Please
register
or
login
to post a comment