Merge branch 'main' into mainPage

This commit is contained in:
Ilia vasilenko 2022-08-27 01:39:09 +03:00 committed by GitHub
commit d950041bf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 4614 additions and 19 deletions

4602
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@
"dependencies": {
"@ant-design/icons": "^4.7.0",
"antd": "^4.22.8",
"axios": "^0.27.2",
"next": "12.2.5",
"react": "18.2.0",
"react-doc-viewer": "^0.1.5",

6
pages/api/check_state.ts Normal file
View File

@ -0,0 +1,6 @@
import {get} from './fetch'
import { check_state_url } from './urls'
export const check_state = async (uid: string) => {
return await get(`${check_state_url}/${uid}`)
}

6
pages/api/fetch.ts Normal file
View File

@ -0,0 +1,6 @@
import axios from 'axios'
import {host} from './consts'
export const get = async (url: string) => {
return (await axios.get(url)).data
}

View File

@ -1,13 +0,0 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next'
type Data = {
name: string
}
export default function handler(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
res.status(200).json({ name: 'John Doe' })
}

5
pages/api/urls.ts Normal file
View File

@ -0,0 +1,5 @@
const check_state_url = '/state'
export {
check_state_url
}