- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将node.js api 服务器部署到Azure。我创建了一个 Azure Web 应用程序,并通过 Azure 门户创建了一个 GitHub 部署。当我推送到存储库时,Action 启动,运行构建脚本,启动 api 服务器,然后挂起而不会出现错误。关于工作流程无法完成的原因有什么想法吗?
我的app.js文件如下:
const express = require('express');
const cors = require('cors');
require('../db/mongoose');
const port = 8897
console.log("Setting port to " + port);
const userRouter = require('../routers/users');
const app = express();
app.use(cors());
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Methods");
next();
});
app.use(express.json());
app.use(userRouter);
app.listen(port, () => {
console.log('API service is up on port ' + port); //<-- this prints in Action logs
});
我的package.json文件如下:
{
"name": "api-dir",
"version": "1.0.0",
"description": "",
"main": "src/app.js",
"scripts": {
"build": "node src/app.js",
"start": "node src/app.js",
"dev": "env-cmd nodemon ./src/app.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"nodemon": "^2.0.15"
},
"dependencies": {
"@sendgrid/mail": "^7.6.1",
"bcrypt": "^5.0.1",
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"env-cmd": "^10.1.0",
"express": "^4.17.2",
"jsonwebtoken": "^9.0.0",
"mongoose": "^6.7.2",
"multer": "^1.4.4",
"sharp": "^0.30.3",
"validator": "^13.7.0"
}
}
我的 GitHub 工作流程如下:
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy Node.js app to Azure Web App - kc-api-server
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: npm install and build
run: |
npm install
npm run build
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: node-app
path: .
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: node-app
- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: 'kc-api-server'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_35B0A707361B49B0865006CA24333347 }}
package: .
工作流日志(我取消工作流后)如下:
2023-05-07T18:28:05.8747790Z Requested labels: ubuntu-latest
2023-05-07T18:28:05.8748121Z Job defined at: KC/api-server/.github/workflows/main_kc-api-server.yml@refs/heads/main
2023-05-07T18:28:05.8748279Z Waiting for a runner to pick up this job...
2023-05-07T18:28:06.1295341Z Job is waiting for a hosted runner to come online.
2023-05-07T18:28:08.2484152Z Job is about to start running on the hosted runner: GitHub Actions 1 (hosted)
2023-05-07T18:28:10.4107610Z Current runner version: '2.304.0'
2023-05-07T18:28:10.4135592Z ##[group]Operating System
2023-05-07T18:28:10.4136169Z Ubuntu
2023-05-07T18:28:10.4136415Z 22.04.2
2023-05-07T18:28:10.4136812Z LTS
2023-05-07T18:28:10.4137128Z ##[endgroup]
2023-05-07T18:28:10.4137402Z ##[group]Runner Image
2023-05-07T18:28:10.4137766Z Image: ubuntu-22.04
2023-05-07T18:28:10.4138088Z Version: 20230426.1
2023-05-07T18:28:10.4138589Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230426.1/images/linux/Ubuntu2204-Readme.md
2023-05-07T18:28:10.4139231Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230426.1
2023-05-07T18:28:10.4139687Z ##[endgroup]
2023-05-07T18:28:10.4139987Z ##[group]Runner Image Provisioner
2023-05-07T18:28:10.4140941Z 2.0.171.1
2023-05-07T18:28:10.4141289Z ##[endgroup]
2023-05-07T18:28:10.4141930Z ##[group]GITHUB_TOKEN Permissions
2023-05-07T18:28:10.4142495Z Contents: read
2023-05-07T18:28:10.4142910Z Metadata: read
2023-05-07T18:28:10.4143447Z Packages: read
2023-05-07T18:28:10.4143870Z ##[endgroup]
2023-05-07T18:28:10.4147641Z Secret source: Actions
2023-05-07T18:28:10.4148112Z Prepare workflow directory
2023-05-07T18:28:10.4873640Z Prepare all required actions
2023-05-07T18:28:10.5054813Z Getting action download info
2023-05-07T18:28:10.7704627Z Download action repository 'actions/checkout@v3' (SHA:8e5e7e5ab8b370d6c329ec480221332ada57f0ab)
2023-05-07T18:28:11.0686996Z Download action repository 'actions/setup-node@v3' (SHA:64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c)
2023-05-07T18:28:11.2834538Z Download action repository 'actions/upload-artifact@v3' (SHA:0b7f8abb1508181956e8e162db84b466c27e18ce)
2023-05-07T18:28:11.5954871Z Complete job name: build
2023-05-07T18:28:11.6881053Z ##[group]Run actions/checkout@v3
2023-05-07T18:28:11.6881442Z with:
2023-05-07T18:28:11.6881762Z repository: KC/api-server
2023-05-07T18:28:11.6882323Z token: ***
2023-05-07T18:28:11.6882603Z ssh-strict: true
2023-05-07T18:28:11.6882908Z persist-credentials: true
2023-05-07T18:28:11.6883221Z clean: true
2023-05-07T18:28:11.6883471Z fetch-depth: 1
2023-05-07T18:28:11.6883728Z lfs: false
2023-05-07T18:28:11.6883994Z submodules: false
2023-05-07T18:28:11.6884287Z set-safe-directory: true
2023-05-07T18:28:11.6884577Z ##[endgroup]
2023-05-07T18:28:11.9099056Z Syncing repository: KC/api-server
2023-05-07T18:28:11.9101128Z ##[group]Getting Git version info
2023-05-07T18:28:11.9101704Z Working directory is '/home/runner/work/api-server/api-server'
2023-05-07T18:28:11.9102333Z [command]/usr/bin/git version
2023-05-07T18:28:11.9203415Z git version 2.40.1
2023-05-07T18:28:11.9234794Z ##[endgroup]
2023-05-07T18:28:11.9254375Z Temporarily overriding HOME='/home/runner/work/_temp/e5a13de1-3fbf-48ba-9450-b2e37dfb7e21' before making global git config changes
2023-05-07T18:28:11.9254954Z Adding repository directory to the temporary git global config as a safe directory
2023-05-07T18:28:11.9255581Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/api-server/api-server
2023-05-07T18:28:11.9298830Z Deleting the contents of '/home/runner/work/api-server/api-server'
2023-05-07T18:28:11.9304474Z ##[group]Initializing the repository
2023-05-07T18:28:11.9308057Z [command]/usr/bin/git init /home/runner/work/api-server/api-server
2023-05-07T18:28:11.9366920Z hint: Using 'master' as the name for the initial branch. This default branch name
2023-05-07T18:28:11.9368047Z hint: is subject to change. To configure the initial branch name to use in all
2023-05-07T18:28:11.9368632Z hint: of your new repositories, which will suppress this warning, call:
2023-05-07T18:28:11.9369122Z hint:
2023-05-07T18:28:11.9369641Z hint: git config --global init.defaultBranch <name>
2023-05-07T18:28:11.9369946Z hint:
2023-05-07T18:28:11.9370345Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2023-05-07T18:28:11.9370861Z hint: 'development'. The just-created branch can be renamed via this command:
2023-05-07T18:28:11.9371175Z hint:
2023-05-07T18:28:11.9371776Z hint: git branch -m <name>
2023-05-07T18:28:11.9380553Z Initialized empty Git repository in /home/runner/work/api-server/api-server/.git/
2023-05-07T18:28:11.9393100Z [command]/usr/bin/git remote add origin https://github.com/KC/api-server
2023-05-07T18:28:11.9434092Z ##[endgroup]
2023-05-07T18:28:11.9444802Z ##[group]Disabling automatic garbage collection
2023-05-07T18:28:11.9445672Z [command]/usr/bin/git config --local gc.auto 0
2023-05-07T18:28:11.9490864Z ##[endgroup]
2023-05-07T18:28:11.9491361Z ##[group]Setting up auth
2023-05-07T18:28:11.9491939Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2023-05-07T18:28:11.9520646Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2023-05-07T18:28:11.9861926Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2023-05-07T18:28:11.9946698Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2023-05-07T18:28:12.0123068Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2023-05-07T18:28:12.0164122Z ##[endgroup]
2023-05-07T18:28:12.0164669Z ##[group]Fetching the repository
2023-05-07T18:28:12.0170945Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +409db5910df0c85b48b01c289762072f7785dc8b:refs/remotes/origin/main
2023-05-07T18:28:12.2754223Z remote: Enumerating objects: 20, done.
2023-05-07T18:28:12.2760761Z remote: Counting objects: 5% (1/20)
2023-05-07T18:28:12.2767020Z remote: Counting objects: 10% (2/20)
2023-05-07T18:28:12.2773896Z remote: Counting objects: 15% (3/20)
2023-05-07T18:28:12.2778768Z remote: Counting objects: 20% (4/20)
2023-05-07T18:28:12.2779537Z remote: Counting objects: 25% (5/20)
2023-05-07T18:28:12.2782672Z remote: Counting objects: 30% (6/20)
2023-05-07T18:28:12.2783251Z remote: Counting objects: 35% (7/20)
2023-05-07T18:28:12.2784494Z remote: Counting objects: 40% (8/20)
2023-05-07T18:28:12.2785187Z remote: Counting objects: 45% (9/20)
2023-05-07T18:28:12.2785855Z remote: Counting objects: 50% (10/20)
2023-05-07T18:28:12.2786474Z remote: Counting objects: 55% (11/20)
2023-05-07T18:28:12.2787159Z remote: Counting objects: 60% (12/20)
2023-05-07T18:28:12.2787711Z remote: Counting objects: 65% (13/20)
2023-05-07T18:28:12.2788229Z remote: Counting objects: 70% (14/20)
2023-05-07T18:28:12.2796404Z remote: Counting objects: 75% (15/20)
2023-05-07T18:28:12.2796995Z remote: Counting objects: 80% (16/20)
2023-05-07T18:28:12.2797483Z remote: Counting objects: 85% (17/20)
2023-05-07T18:28:12.2797957Z remote: Counting objects: 90% (18/20)
2023-05-07T18:28:12.2798383Z remote: Counting objects: 95% (19/20)
2023-05-07T18:28:12.2798826Z remote: Counting objects: 100% (20/20)
2023-05-07T18:28:12.2834776Z remote: Counting objects: 100% (20/20), done.
2023-05-07T18:28:12.2835147Z remote: Compressing objects: 6% (1/15)
2023-05-07T18:28:12.2835471Z remote: Compressing objects: 13% (2/15)
2023-05-07T18:28:12.2835799Z remote: Compressing objects: 20% (3/15)
2023-05-07T18:28:12.2836126Z remote: Compressing objects: 26% (4/15)
2023-05-07T18:28:12.2836439Z remote: Compressing objects: 33% (5/15)
2023-05-07T18:28:12.2836776Z remote: Compressing objects: 40% (6/15)
2023-05-07T18:28:12.2837103Z remote: Compressing objects: 46% (7/15)
2023-05-07T18:28:12.2837411Z remote: Compressing objects: 53% (8/15)
2023-05-07T18:28:12.2837735Z remote: Compressing objects: 60% (9/15)
2023-05-07T18:28:12.2838327Z remote: Compressing objects: 66% (10/15)
2023-05-07T18:28:12.2838659Z remote: Compressing objects: 73% (11/15)
2023-05-07T18:28:12.2838974Z remote: Compressing objects: 80% (12/15)
2023-05-07T18:28:12.2839301Z remote: Compressing objects: 86% (13/15)
2023-05-07T18:28:12.2839624Z remote: Compressing objects: 93% (14/15)
2023-05-07T18:28:12.2839933Z remote: Compressing objects: 100% (15/15)
2023-05-07T18:28:12.2840276Z remote: Compressing objects: 100% (15/15), done.
2023-05-07T18:28:12.2840937Z remote: Total 20 (delta 0), reused 13 (delta 0), pack-reused 0
2023-05-07T18:28:12.2872990Z From https://github.com/KC/api-server
2023-05-07T18:28:12.2873563Z * [new ref] 409db5910df0c85b48b01c289762072f7785dc8b -> origin/main
2023-05-07T18:28:12.3041076Z ##[endgroup]
2023-05-07T18:28:12.3041610Z ##[group]Determining the checkout info
2023-05-07T18:28:12.3044729Z ##[endgroup]
2023-05-07T18:28:12.3045196Z ##[group]Checking out the ref
2023-05-07T18:28:12.3049675Z [command]/usr/bin/git checkout --progress --force -B main refs/remotes/origin/main
2023-05-07T18:28:12.3104824Z Switched to a new branch 'main'
2023-05-07T18:28:12.3110744Z branch 'main' set up to track 'origin/main'.
2023-05-07T18:28:12.3115007Z ##[endgroup]
2023-05-07T18:28:12.3157344Z [command]/usr/bin/git log -1 --format='%H'
2023-05-07T18:28:12.3186581Z '409db5910df0c85b48b01c289762072f7785dc8b'
2023-05-07T18:28:12.3533586Z ##[group]Run actions/setup-node@v3
2023-05-07T18:28:12.3533891Z with:
2023-05-07T18:28:12.3534116Z node-version: 18.x
2023-05-07T18:28:12.3534372Z always-auth: false
2023-05-07T18:28:12.3534632Z check-latest: false
2023-05-07T18:28:12.3535072Z token: ***
2023-05-07T18:28:12.3535289Z ##[endgroup]
2023-05-07T18:28:12.5684641Z Found in cache @ /opt/hostedtoolcache/node/18.16.0/x64
2023-05-07T18:28:12.5685236Z ##[group]Environment details
2023-05-07T18:28:18.2281526Z node: v18.16.0
2023-05-07T18:28:18.2282323Z npm: 9.5.1
2023-05-07T18:28:18.2282705Z yarn: 1.22.19
2023-05-07T18:28:18.2283659Z ##[endgroup]
2023-05-07T18:28:18.2454901Z ##[group]Run npm install
2023-05-07T18:28:18.2455206Z [36;1mnpm install[0m
2023-05-07T18:28:18.2455428Z [36;1mnpm run build[0m
2023-05-07T18:28:18.2513432Z shell: /usr/bin/bash -e {0}
2023-05-07T18:28:18.2513683Z ##[endgroup]
2023-05-07T18:28:28.0153756Z npm WARN deprecated <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="18756d746c7d6a5829362c362c" rel="noreferrer noopener nofollow">[email protected]</a>: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.
2023-05-07T18:28:29.8360526Z
2023-05-07T18:28:29.8361601Z added 323 packages, and audited 324 packages in 11s
2023-05-07T18:28:29.8362063Z
2023-05-07T18:28:29.8362472Z 25 packages are looking for funding
2023-05-07T18:28:29.8362961Z run `npm fund` for details
2023-05-07T18:28:29.8389572Z
2023-05-07T18:28:29.8399556Z 3 high severity vulnerabilities
2023-05-07T18:28:29.8400055Z
2023-05-07T18:28:29.8400606Z Some issues need review, and may require choosing
2023-05-07T18:28:29.8401076Z a different dependency.
2023-05-07T18:28:29.8401372Z
2023-05-07T18:28:29.8401798Z Run `npm audit` for details.
2023-05-07T18:28:30.2467086Z
2023-05-07T18:28:30.2468430Z > <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0e6f7e67236a677c4e3f203e203e" rel="noreferrer noopener nofollow">[email protected]</a> build
2023-05-07T18:28:30.2469058Z > node src/app.js
2023-05-07T18:28:30.2469500Z
2023-05-07T18:28:30.5864539Z Connecting to ***cluster0.hcwrc.mongodb.net/KC?authSource=test&replicaSet=atlas-xaxq3n-shard-0&readPreference=primary&ssl=true
2023-05-07T18:28:30.6003857Z Setting port to 8897
2023-05-07T18:28:30.7253249Z (node:1831) [MONGOOSE] DeprecationWarning: Mongoose: the `strictQuery` option will be switched back to `false` by default in Mongoose 7. Use `mongoose.set('strictQuery', false);` if you want to prepare for this change. Or use `mongoose.set('strictQuery', true);` to suppress this warning.
2023-05-07T18:28:30.7254519Z **API service is up on port 8897**
2023-05-07T18:28:30.7255759Z (Use `node --trace-deprecation ...` to show where the warning was created)
2023-05-07T18:50:41.1827979Z ##[error]The operation was canceled.
2023-05-07T18:50:41.1883321Z Post job cleanup.
2023-05-07T18:50:41.3642123Z [command]/usr/bin/git version
2023-05-07T18:50:41.3642407Z git version 2.40.1
2023-05-07T18:50:41.3645275Z Temporarily overriding HOME='/home/runner/work/_temp/d2e11fe2-4452-4f9f-8d29-1c86bb3938ff' before making global git config changes
2023-05-07T18:50:41.3645854Z Adding repository directory to the temporary git global config as a safe directory
2023-05-07T18:50:41.3646677Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/api-server/api-server
2023-05-07T18:50:41.3647731Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2023-05-07T18:50:41.3649130Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2023-05-07T18:50:41.3650436Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2023-05-07T18:50:41.3651017Z http.https://github.com/.extraheader
2023-05-07T18:50:41.3652180Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2023-05-07T18:50:41.3653835Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2023-05-07T18:50:41.3784140Z Cleaning up orphan processes
2023-05-07T18:50:41.4016340Z Terminate orphan process: pid (1819) (npm run build)
2023-05-07T18:50:41.4068420Z Terminate orphan process: pid (1830) (sh)
2023-05-07T18:50:41.4088311Z Terminate orphan process: pid (1831) (node)
最佳答案
问题已经解决了。我在 package.json 中有一个“构建”脚本,它与“启动”脚本执行相同的操作,即
"build": "node src/app.js"
GitHub 工作流程将运行构建脚本,从而启动服务器,当然,服务器不会终止。
从 package.json 中删除“构建”脚本可以让工作流程完成。
关于node.js - Azure Web 应用程序的 GitHub 部署不会停止 Node.js API 服务器的 'build' 作业(无错误),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76195851/
我正在学习构建单页应用程序 (SPA) 所需的所有技术。总而言之,我想将我的应用程序实现为单独的层,其中前端仅使用 API Web 服务(json 通过 socket.io)与后端通信。前端基本上是
当我看到存储在我的数据库中的日期时。 这是 正常 。日期和时间就是这样。 但是当我运行 get 请求来获取数据时。 此格式与存储在数据库 中的格式不同。为什么会发生这种情况? 最佳答案 我认为您可以将
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我正在尝试使用backbone.js 实现一些代码 和 hogan.js (http://twitter.github.com/hogan.js/) Hogan.js was developed ag
我正在使用 Backbone.js、Node.js 和 Express.js 制作一个 Web 应用程序,并且想要添加用户功能(登录、注销、配置文件、显示内容与该用户相关)。我打算使用 Passpor
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 8 年前。 Improve this ques
我尝试在 NodeJS 中加载数据,然后将其传递给 ExpressJS 以在浏览器中呈现 d3 图表。 我知道我可以通过这种方式加载数据 - https://github.com/mbostock/q
在 node.js 中,我似乎遇到了相同的 3 个文件名来描述应用程序的主要入口点: 使用 express-generator 包时,会创建一个 app.js 文件作为生成应用的主要入口点。 通过 n
最近,我有机会观看了 john papa 关于构建单页应用程序的精彩类(class)。我会喜欢的。它涉及服务器端和客户端应用程序的方方面面。 我更喜欢客户端。在他的实现过程中,papa先生在客户端有类
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我是一个图形新手,需要帮助了解各种 javascript 2D 库的功能。 . . 我从 Pixi.js 中得到了什么,而我没有从 Konva 等基于 Canvas 的库中得到什么? 我从 Konva
我正在尝试将一些 LESS 代码(通过 ember-cli-less)构建到 CSS 文件中。 1) https://almsaeedstudio.com/ AdminLTE LESS 文件2) Bo
尝试查看 Express Passport 中所有登录用户的所有 session ,并希望能够查看当前登录的用户。最好和最快的方法是什么? 我在想也许我可以在登录时执行此操作并将用户模型数据库“在线”
我有一个 React 应用程序,但我需要在组件加载完成后运行一些客户端 js。一旦渲染函数完成并加载,运行与 DOM 交互的 js 的最佳方式是什么,例如 $('div').mixItUp() 。对
请告诉我如何使用bodyparser.raw()将文件上传到express.js服务器 客户端 // ... onFilePicked(file) { const url = 'upload/a
我正在尝试从 Grunt 迁移到 Gulp。这个项目在 Grunt 下运行得很好,所以我一定是在 Gulp 中做错了什么。 除脚本外,所有其他任务均有效。我现在厌倦了添加和注释部分。 我不断收到与意外
我正在尝试更改我的网站名称。找不到可以设置标题或应用程序名称的位置。 最佳答案 您可以在 config/ 目录中创建任何文件,例如 config/app.js 包含如下内容: module.expor
经过多年的服务器端 PHP/MySQL 开发,我正在尝试探索用于构建现代 Web 应用程序的新技术。 我正在尝试对所有 JavaScript 内容进行排序,如果我理解得很好,一个有效的解决方案可以是服
我是 Nodejs 的新手。我在 route 目录中有一个 app.js 和一个 index.js。我有一个 app.use(multer....)。我还定义了 app.post('filter-re
我正在使用 angular-seed用于构建我的应用程序的模板。最初,我将所有 JavaScript 代码放入一个文件 main.js。该文件包含我的模块声明、 Controller 、指令、过滤器和
我是一名优秀的程序员,十分优秀!