Coder Social home page Coder Social logo

somewhereintheword / moa-frontend Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moajs/moa-frontend

0.0 2.0 0.0 1.73 MB

Moajs frontend framework with jQuery + bootstrap

Home Page: https://github.com/moajs/moa-frontend

JavaScript 42.25% HTML 8.99% CSS 37.70% CoffeeScript 11.06%

moa-frontend's Introduction

Moa-Frontend

技术栈

  • express
  • jade
  • bootstrap
  • bootstraptable
  • jquery
  • gulp
  • nginx

前后端分离实践

  • 前端:moa-frontend
    • public下面的采用nginx做反向代理
    • 其他的采用express+jade精简代码(ajax与后端交互)
  • 后端:moa-api

Install

npm install 
npm start

访问 http://127.0.0.1:3010/

Features

  • 经典的 jQuery + bootstrap 简单易用
  • 响应式,兼容移动端和pc端
  • expressjs + jade 代码极简,功能强大
  • 自动挂载路由,在routes目录创建js文件会被自动识别,无需在app.js里配置
  • 代码变动,自动重启服务器
  • 支持log4js日志
  • 内置simditor和七牛上传图片
  • 内置uploadify文件上传
  • 使用gulp构建

Configuration

nginx

  • 复制config/nginx.example.conf为config/nginx.conf
  • 修改config/nginx.conf相关端口配置
  • 执行gulp nginx

说明

  • 实际端口8000
  • 前端端口3010
  • api端口3005

simditor_qn

  • 复制config/simditor_qn.example.conf为config/simditor_qn.conf
module.exports = {
  path: '/simditor/upload',
  fileKey: 'file',
	multer:{ 
	 	dest: 'uploads/' 
	},
	qn:{
		accessKey: 'xxx',
		secretKey: 'yyy',
		bucket: 'mengxiaoban',
		origin: 'http://{bucket}.u.qiniudn.com',
		// timeout: 3600000, // default rpc timeout: one hour, optional
		// if your app outside of China, please set `uploadURL` to `http://up.qiniug.com/`
		// uploadURL: 'http://up.qiniu.com/',
	},
	url:function(result){
		return "http://img.mengxiaoban.cn/" + result.hash;
	}
}

说明

  • path 是simditor里使用的上传路径
  • fileKey 是上传后,路由里req获取的字段名称
  • multer是express里multer中间件的配置
  • qn是qn这个node模块的配置
  • url是最终图片地址,可以自己定义

Tasks

  • npm start 启动服务器
  • gulp routes 打印路由
  • gulp kp 停止服务器
  • gulp nginx 启动nginx服务器
  • gulp 跑测试,依赖gulp watchgulp mocha

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

版本历史

  • v0.1.0 初始化版本

欢迎fork和反馈

如有建议或意见,请在issue提问或邮件

License

this repo is released under the MIT License.

moa-frontend's People

Contributors

aprilclj avatar i5ting avatar modood avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.