yi-ge / koa2-api-scaffold Goto Github PK
View Code? Open in Web Editor NEW一个基于Koa2的轻量级RESTful API Server脚手架。
License: Do What The F*ck You Want To Public License
一个基于Koa2的轻量级RESTful API Server脚手架。
License: Do What The F*ck You Want To Public License
我使用你的这个尝试做来一个项目,本地环境已经正常跑通来,部署线上环境各种不对。node npm pm2 都装了 是直接允许pm2 start pm2.js吗?
远程服务器运行会报这个错误,本地运行时没有问题的,请问一下这个是什么问题啊
src/app.js -> dist/app.js
src/config.js -> dist/config.js
src/controllers/api.js -> dist/controllers/api.js
src/controllers/auth.js -> dist/controllers/auth.js
src/controllers/fosan.js -> dist/controllers/fosan.js
src/controllers/index.js -> dist/controllers/index.js
src/controllers/upload.js -> dist/controllers/upload.js
src/lib/PluginLoader.js -> dist/lib/PluginLoader.js
src/lib/sequelize.js -> dist/lib/sequelize.js
src/middleware/ErrorRoutesCatch.js -> dist/middleware/ErrorRoutesCatch.js
src/models/index.js -> dist/models/index.js
src/plugins/smtp_sendemail/index.js -> dist/plugins/smtp_sendemail/index.js
src/routes/error-routes.js -> dist/routes/error-routes.js
src/routes/main-routes.js -> dist/routes/main-routes.js
src/tool/Common.js -> dist/tool/Common.js
[root@iZ5iaszuifir7xZ fosan]# npm run production
[email protected] production /root/fosan
node dist/app.js
/root/fosan/node_modules/koa-jwt/lib/index.js:18
const middleware = async function jwt(ctx, next) {
^^^^^^^^
SyntaxError: Unexpected token function
tool.js中getsec()方法未定义
好像和koa2的证书不一样,不知道从哪配,麻烦了
大神,我是个小白,我想问一下,怎么保证node.js服务器的进程一直进行啊,就你这个框架而言
upload.js中“var files = ctx.request.body.files”是否应该替换为“var files = ctx.request..files”
Break on start in file:///Users/liubolun/WebstormProjects/Koa2-API-Scaffold/build/dev-server.js:1
1 (function (exports, require, module, __filename, __dirname) { require('babel-register')
2 require('../src/app')
这怎么解决啊亲
怎么用呢?新手感觉无从下手啊。有没有样例什么的?还有就是我跑起来,测试路由都是返回Authentication Error 还需要什么权限吗?
楼主有没有部署都教程啊,我初学好难部署啊!
我在服务器上安装了node pm2 项目该如何启动起来。
我尝试用npm run dev 和npm run start去运行都提示es6都import语法错误
还有pm2启动项目是直接运行pm2.js吗还是钥自己写个配置文件
求恢复 急急急
Node.js X64 10.4.0
Npm 6.1.0
运行
npm run dev
结果如下:
> [email protected] dev D:\00.Projects\api_koa2
> gulp
gulp[18288]: src\node_contextify.cc:629: Assertion `args[1]->IsString()' failed.
1: node::DecodeWrite
2: node::DecodeWrite
3: uv_loop_fork
4: v8::internal::FeedbackVector::New
5: v8::internal::FeedbackVector::New
6: v8::internal::FeedbackVector::New
7: v8::internal::FeedbackVector::New
8: 000002A92C2841C1
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! [email protected] dev: `gulp`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Dev\npm-cache\_logs\2018-07-21T09_56_01_127Z-debug.log
因为本人接触mongodb一些基础,mysql不太懂。打算做一个项目用到支付模块,但是mongodb没有滚回,我该不该继续选用mongodb做数据库了?
大佬会出一个TypeScript版本吗?
vs 里配置调试
"program": "${workspaceFolder}/dist/app" 只能对构建后的才行。如何调试构建之前的呢?
"program": "${workspaceFolder}/ ?" 这样启动npm run dev
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.