Я пытаюсь развернуть свой бэкэнд. Я вижу ошибку 404, код не найден. Я до сих пор вижу ошибку.//tsconfig.json
{
"compilerOptions": {
"module": "nodenext",
"target": "esnext",
"types": [],
"sourceMap": true,
"declaration": true,
"declarationMap": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"strict": true,
"jsx": "react-jsx",
"verbatimModuleSyntax": true,
"isolatedModules": true,
"noUncheckedSideEffectImports": true,
"moduleDetection": "force",
"skipLibCheck": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
< /code>
//package.json
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "dist/Server.js",
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsx watch src/Server.ts",
"start": "node dist/Server.js",
"check-types": "tsc --noEmit",
"lint": "eslint ."
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"mongoose": "^8.18.0"
},
"devDependencies": {
"tsx": "^4.20.5"
}
}
< /code>
//app>src>Server.ts
import express from "express";
if (process.env.NODE_ENV !== "production") {
import("dotenv").then((dotenv) => dotenv.config({ path: "./.env" }));
}
const app: express.Application = express();
app.use(express.json());
app.get("/", (req, res) => {
res.send("Hello From the server");
});
app.get("/api/v1/health", (req, res) => {
res.json({ status: "OK" });
});
if (process.env.VERCEL === undefined) {
app.listen(process.env.PORT || 3000, () => {
console.log(`The app is running on PORT: ${process.env.PORT || 3000}`);
});
}
export default app;
< /code>
I want to know why this is happening for node js specific application and how to resolve this issue.
Thanks in advance
Подробнее здесь: https://stackoverflow.com/questions/797 ... pplication
Получение кода не найдено ошибки в Vercel Deploynment для приложения Node JS ⇐ Javascript
Форум по Javascript
1757738360
Anonymous
Я пытаюсь развернуть свой бэкэнд. Я вижу ошибку 404, код не найден. Я до сих пор вижу ошибку.//tsconfig.json
{
"compilerOptions": {
"module": "nodenext",
"target": "esnext",
"types": [],
"sourceMap": true,
"declaration": true,
"declarationMap": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"strict": true,
"jsx": "react-jsx",
"verbatimModuleSyntax": true,
"isolatedModules": true,
"noUncheckedSideEffectImports": true,
"moduleDetection": "force",
"skipLibCheck": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
< /code>
//package.json
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "dist/Server.js",
"type": "module",
"scripts": {
"build": "tsc",
"dev": "tsx watch src/Server.ts",
"start": "node dist/Server.js",
"check-types": "tsc --noEmit",
"lint": "eslint ."
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"mongoose": "^8.18.0"
},
"devDependencies": {
"tsx": "^4.20.5"
}
}
< /code>
//app>src>Server.ts
import express from "express";
if (process.env.NODE_ENV !== "production") {
import("dotenv").then((dotenv) => dotenv.config({ path: "./.env" }));
}
const app: express.Application = express();
app.use(express.json());
app.get("/", (req, res) => {
res.send("Hello From the server");
});
app.get("/api/v1/health", (req, res) => {
res.json({ status: "OK" });
});
if (process.env.VERCEL === undefined) {
app.listen(process.env.PORT || 3000, () => {
console.log(`The app is running on PORT: ${process.env.PORT || 3000}`);
});
}
export default app;
< /code>
I want to know why this is happening for node js specific application and how to resolve this issue.
Thanks in advance
Подробнее здесь: [url]https://stackoverflow.com/questions/79763505/getting-code-not-found-error-in-vercel-deploynment-for-node-js-application[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия