Setting up next serverless function

This commit is contained in:
Jamie Hewitt 2022-08-16 18:30:40 +03:00
parent 2f12e3a4f5
commit 5a380e7343
7 changed files with 1628 additions and 41 deletions

1
.husky/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
_

4
.husky/pre-commit Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
node_modules/.bin/pretty-quick --staged

7
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"wix.vscode-import-cost"
]
}

17
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"search.exclude": {
"**/.cache": true,
"**/public": true
}
}

16
app.ts Normal file
View File

@ -0,0 +1,16 @@
import express from 'express'
import cors from 'cors'
const app = express()
const port = 3000
import indexRouter from './routes/index'
app.use(express.json())
app.use(cors())
app.use('/', indexRouter)
app.listen(port, () => {
console.log(`Price Request App listening at http://localhost:${port}`)
})
export default app

1622
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,8 @@
"test": "npm run test:format && npm run test:integration" "test": "npm run test:format && npm run test:integration"
}, },
"dependencies": { "dependencies": {
"cors": "^2.8.5",
"next": "^12.2.5"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.18.5", "@babel/core": "^7.18.5",