bailicangdu / node-elm Goto Github PK
View Code? Open in Web Editor NEWBackend system based on node.js + Mongodb. 基于 node.js + Mongodb 构建的后台系统
Home Page: https://cangdu.org/elm/
License: GNU General Public License v2.0
Backend system based on node.js + Mongodb. 基于 node.js + Mongodb 构建的后台系统
Home Page: https://cangdu.org/elm/
License: GNU General Public License v2.0
PS C:\Users\XieHaitao\Desktop\node-elm-master> npm run dev
[email protected] dev C:\Users\XieHaitao\Desktop\node-elm-master
NODE_ENV=development supervisor --harmony index.js
'NODE_ENV' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "ru
" "dev"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] dev: NODE_ENV=development supervisor --harmony index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script 'NODE_ENV=development supervisor --harmony index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-elm package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! NODE_ENV=development supervisor --harmony index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-elm
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-elm
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\XieHaitao\Desktop\node-elm-master\npm-debug.log
PS C:\Users\XieHaitao\Desktop\node-elm-master>
是不是 大神 你服务挂了啊?????
数据管理那个节点下面有点卡 而且分页也有点卡 建议做个加载动画吧 还有订单详情点击不同的订单信息变为一样了
我偶然找到这个项目, 我也刚学完node mongodb express, 只是对单元测试还是比较陌生。 感兴趣的话可以一起探讨技术! 我的微信 peterbugman
直接访问http://cangdu.org/manage/#/manage 也能够进入管理界面,但是管理员信息为空
大神,以后能用上KOA2吗?
初始化是在哪个地方呢
你好,req.session.admin_id = admin_id;
这不意味着每次只能有一个用户登录么?那么我两个用户同时登录怎么办?求大神指点
...
await fs.rename(files.file.path, repath);
gm(repath)
...
这里在gm方法执行的时候,报错了,显示找不到repath这个路径;
然后我把fs.rename改成同步的方式就可以了;难道是await在这里没起作用吗;
form.parse(req, async (err, fields, files) => {
此处files读不到数据,我正在调,如果能调好我push。
在这个网址里:http://cangdu.org/manage/#/foodList
点击了水饺之后,显示正常,但点击鸡翅后,就显示鸡翅了,连之前的水饺也显示为鸡翅了。
我是新手,但感觉拿这个项目的代码来学习是非常好的,感谢分享!
请问数据表能提供下吗,谢谢
我在搭建项目时添加的 babel 插件和你的一样,但是用 supervisor --harmony
的方式启动的话它不是别 es6 的 module,如果添加 babel 插件,以 babel-node index
的方式启动是可以支持的,但是这样每次修改都需要手动启动一次,请问作者是如何实现这两个的兼容的?有什么更好的解决办法吗?
// 获取管理员信息
export const getAdminInfo = () => axios.get('/admin/info')
结果为
{"status":0,"type":"ERROR_SESSION","message":"获取管理员信息失败"}
如何才能得到正确的管理员信息
这个我运行npm run dev,访问的是前台地址,那后台地址怎么访问啊
个人建议用,koa+sequelize实现,node接口会更优雅。另外看了一部分node项目目录结构,感觉不太好。。另外还是很佩服作者vue项目的,写得很棒!
cangdu大神,我特别好奇你的node是怎么学的。有点6啊,有何学习网站推荐没?还有你引入的qiniu这个云储存api到底是干嘛用的呢?
你好,我之前一直是用c++,c#开发得比较多,c和java也有用。现在正学习node和javascript做web开发,但有一些地方还没搞明白。我看了好几本node的书籍,都没有找到项目复杂度比较高的例程,基本是一个知识点一个模块,没有很健全的模块体系,还是搞不清这种异步编程**。你这开源项目做得挺大的,应该能给我答疑。
在C#,C++开发时,是可以主类中定义一些完成不同功能的成员,然后主类的方法中操作这些成员执行相应的功能和逻辑,而成员也可以通过事件或返回值的方式把执行结果反馈到主类。但在搞node+express的时候,就不懂怎样让app.js中的对象和子模块的对象进行交互、不同模块之间要动态传数据时是怎样的方式。比如说,我每个请求路由都独立成js文件了,浏览器有请求的时候,我要返回给浏览器的数据是需要从app.js的对象中获取的,那该怎样跨文件传到我的路由.js文件上?
为什么用vue写的项目 打包后 访问这个http://cangdu.org:8001/admin/info 这个接口 返回的数据是{"status":0,"type":"ERROR_SESSION","message":"获取管理员信息失败"} 在本地访问没什么问题 本地用的是代理,获取数据使用的是axios 我给它配置了默认路径 axios.defaults.baseURL = process.env.NODE_ENV === 'production' ? 'http://cangdu.org:8001' : '/api';
大神,您的好几个仓库我都关注了,您简直是我们的福音,但是本人有点菜,我有几个疑惑想不通,想问一下。
我看到 您的域名是同一个 http://cangdu.org,服务器也是同一个(阿里云),在项目很多的情况下,您为每个项目分配不同的端口号或者不同的子文件夹。比如:
app.use('/manage', manage); // 渲染manage的html给后台管理系统项目
app.use('/pxq', pxq); // 渲染pxq的html给后台管理系统项目
微信小程序端。
http://localhost:8001/home 没找到这个路由
/Users/tomato/Sites/vue-test/node-elm/app.js:72
name: _configLite2.default.session.name,
^
TypeError: Cannot read property 'name' of undefined
at Object.<anonymous> (/Users/tomato/Sites/vue-test/node-elm/app.js:33:11)
at Module._compile (module.js:573:30)
at loader (/Users/tomato/Sites/vue-test/node-elm/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/tomato/Sites/vue-test/node-elm/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/tomato/Sites/vue-test/node-elm/index.js:2:1)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Function.Module.runMain (module.js:609:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:598:3
建议尽量使用一种模块加载方式,配置文件使用module.exports的Commonjs模块加载方式,其他代码多半有使用ES7的模块加载方式
版本错误?访问http://localhost:8001/是前台的页面
使用babel-plugin-transform-es2015-modules-commonjs插件
key 已经换成 自己的 ,还是报错
端口:8001
/v1/cities
http://cangdu.org:8001/v1/cities?type=guess
GET
参数 | 是否必选 | 类型 | 说明 |
---|---|---|---|
type | Y | string | 类型 guess:定位城市, hot:热门城市, group:所有城市 |
{
id: 1,
name: "上海",
abbr: "SH",
area_code: "021",
sort: 1,
latitude: 31.23037,
longitude: 121.473701,
is_map: true,
pinyin: "shanghai"
}
/v1/cities/:id
GET
参数 | 是否必选 | 类型 | 说明 |
---|---|---|---|
id | Y | int | 城市id |
{
id: 1,
name: "上海",
abbr: "SH",
area_code: "021",
sort: 1,
latitude: 31.23037,
longitude: 121.473701,
is_map: true,
pinyin: "shanghai"
}
/v1/pois
http://cangdu.org:8001/v1/pois?city_id=1&keyword=迪士尼&type=search
GET
参数 | 是否必选 | 类型 | 说明 |
---|---|---|---|
city_id | Y | int | 城市id |
keyword | Y | string | 搜索关键词 |
type | N | string | 搜索类型,默认为search |
返回示例
[
{
name: "上海迪士尼乐园",
address: "上海市浦东新区申迪西路753号",
latitude: 31.14419,
longitude: 121.66034,
geohash: "31.14419,121.66034"
},
{
name: "迪士尼",
address: "上海市浦东新区妙境路1118号家乐福川沙店1层",
latitude: 31.18183,
longitude: 121.69279,
geohash: "31.18183,121.69279"
},
... //共10个数据
]
大神好,我刚开始学习vue,只看了几个视频和代码,对vue一片朦胧,感觉还是做项目来的实在。准备从零开始写大神的这个项目来学习vue。请问我可以把过程发布到segmentfault么?如果可以的话需要注意些什么呢?
hi guys
thank you for your work.
but I think It will be so good if you translate this repo to English.
前端项目里的online地址改成我自己的域名:8001来访问的,公网ip映射到内网对应的ip和端口。
我把addressComponent.js里写死的ip去掉了
然后运行后,前端得到ERR_DATA
后端看显示的是局域网ip无法获取位置
请问这里node-elm应该怎么配置运行才行呢?
大神这个错误怎么处理啊!!!
Error: Cannot find module 'local' from 'E:\node-elm\mongodb'
at Function.module.exports [as sync] (E:\node-elm\node_modules\resolve\lib\sync.js:33:11)
at loadConfig (E:\node-elm\node_modules\config-lite\index.js:37:26)
at Object. (E:\node-elm\node_modules\config-lite\index.js:22:22)
at Module._compile (module.js:571:32)
at Module._extensions..js (module.js:580:10)
at Object.require.extensions.(anonymous function) [as .js] (E:\node-elm\node_modules\babel-register\lib\node.js:152:7)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at require (internal/module.js:20:19)
at Object. (E:/node-elm/mongodb/db.js:4:1)
at Module._compile (module.js:571:32)
at loader (E:\node-elm\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (E:\node-elm\node_modules\babel-register\lib\node.js:154:7)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
希望可以有个项目目录结构说明
大大你好 最近数据显示async会跟别的比较下运行时消耗时间相对较长 有想过未来会换别的异步的方法吗?假如有的话你会首选哪个 想听听你的看法~
https://github.com/bailicangdu/node-elm/blob/master/app.js#L73
这行代码不会生效的吧 中间件只有三个参数啊
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.