1
어느 날, 클래스 모니터는 학생들이 위치를 공유 할 수있는 주소록을 개발하기를 원했기 때문에 단순히 기능 자체를 설계했습니다. 사용자 역할, Weibo에 게시, 장소 공유 등을 포함하여 이번에는 약간 이기적이었습니다. 최근에 시청 한 AngularJS를 운동하기 위해 Node.js + Mongodb + Angular.js 솔루션을 결정적으로 선택했습니다. 물론 Node.js 개발 경험은 점점 더 심오 해지고 있습니다. 작년에 리더는 노드의 각 서비스가 하나의 비즈니스 기능 만 지원하여 유지하기에 더 편리 할 수 있도록 노력해야한다고 말했습니다. 그 당시 나는 노드 서비스를 매우 강력하게 만들고 싶었습니다. 이제 리더의 접근 방식이 정확한 것으로 보이며 노드 서비스 기능을 단독으로 선호합니다 ...
2. 마른 제품을 직접 업로드하십시오
데이터베이스 서비스는 Alibaba Cloud에 배포됩니다. 정적 파일 서버는 github 페이지를 사용합니다.
GitHub 프로젝트 주소 : https://github.com/vczero/ourtimes
온라인 경험 주소 : http://vczero.github.io/tuban/main.html#/
나는 공을 말할 사진이 없다. 두 개의 스크린 샷을 보여 드리겠습니다.
(1) 홈페이지
(2) 주소록
...... 온라인에서 더 많은 경험 ...
III. 프로젝트
총 프로젝트 : https://github.com/vczero/ourtimes
필요한 서비스를 개발했습니다 : https://github.com/vczero/ourtimes/tree/master/server
웹 PC 클라이언트를 엽니 다 : https://github.com/vczero/ourtimes/tree/master/client-web
간단한 백엔드 관리 시스템이 개발되었습니다 : https://github.com/vczero/ourtimes/tree/master/client-admin
모든 사람은 포크에 오신 것을 환영합니다. 코드를 공유하여 코드를 공유하여 프론트 엔드를 구축합니다.
4. 웹 -PC 터미널 각도의 항목 파일 코드 첨부
코드 사본은 다음과 같습니다.
var app = angular.module ( 'app', [ 'ui.router', 'ngcookies']);
var server_base_url = 'http://127.0.0.1:3000/';
// 구성을 초기화합니다
app.run ([ '$ rootscope', function ($ rootscope) {
$ rootscope.appname = 'tuban.com';
$ rootscope.desc = '위치 기반 주소록';
$ Rootscope.author = '고스트 소문';
$ rootscope._email = '[email protected]';
}]);
// 확인 된 서비스 목록
app.constant ( 'serviceconfig', {
wei_content : server_base_url + 'wei/get',
wei_zan : server_base_url + 'wei/zan',
wei_comment : server_base_url + 'wei/comment',
wei_create : server_base_url + 'wei/create',
user_get : server_base_url + 'user/get',
user_login : server_base_url + '사용자/로그인',
user_register : server_base_url + 'User/Register',
user_common : server_base_url + 'user/getcommon',
user_ben : server_base_url + 'user/getben',
user_self : server_base_url + 'user/getself',
user_common_update : server_base_url + 'user/updatecommon',
user_ben_update : server_base_url + 'user/updateben',
user_ben_get_name : server_base_url + 'user/singleben/name',
user_common_get_nickname : server_base_url + 'user/getcommon/name',
user_ben_get_realname : server_base_url + 'user/singleben/name',
wei_get_token_page : server_base_url + 'wei/getbytoken',
wei_delete : server_base_url + 'wei/delete',
user_update_password : server_base_url + 'user/updatepassword',
article_get : server_base_url + 'article/get',
article_detail : server_base_url + 'article/get/id',
amap_url : 'http://webapi.amap.com/maps?v=1.3&key=ad925c500376009471375d64748d872&callback=init'
});
// JSON 파스
app.config ([ '$ httpprovider', function ($ httpprovider) {
$ httpprovider.defaults.headers.post [ 'content-type'] = 'application/x www-form-urlencoded; charset = utf-8';
$ httpprovider.defaults.headers.put [ 'content-type'] = 'application/x www-form-urlencoded; charset = utf-8';
$ httpprovider.defaults.transformrequest = [function (data) {
var obj = [];
for (데이터의 var 키) {
obj.push (key + '=' + data [key]);
}
return obj.join ( '&');
}];
}]);
// 라우팅 구성
app.config ([ '$ stateprovider', '$ urlrouterprovider',
함수 ($ StateProvider, $ URLROUTERPROVIDER) {
/*URL 라우팅*/
$ urlrouterProvider.otherwise ( "/");
/*상태 구성*/
$ StateProvider
// 첫 페이지
.STATE ( 'index', {
URL : '/',
보기 : {
'': {
TemplateUrl : 'views/index/index.html',
},
'header@index': {
templateUrl : 'views/header.html',
컨트롤러 : 'HeaderController'
},
'바닥@색인': {
templateUrl : 'views/footer.html',
컨트롤러 : ''
},
'weibo@index': {
TemplateUrl : 'views/index/weibo.html',
컨트롤러 : 'Weibocontroller'
},
'기사@index': {
TemplateUrl : 'views/index/article.html',
컨트롤러 : 'ArticleController'
},
'post@index': {
TemplateUrl : 'views/index/post.html',
컨트롤러 : 'Postweibocontroller'
}
}
})
.STATE ( '로그인', {
URL : '/로그인',
보기 : {
'': {
TemplateUrl : '보기/로그인/로그인 .html',
컨트롤러 : 'logincontroller'
}
}
})
.STATE ( 'Register', {
URL : '/register',
보기 : {
'': {
templateUrl : 'views/register/register.html',
컨트롤러 : 'RegisterController'
}
}
})
.state ( 'contacts', {
URL : '/contacts',
보기 : {
'': {
TemplateUrl : '보기/연락처/contacts.html',
컨트롤러 : ''
},
'header@contacts': {
templateUrl : 'views/header.html',
컨트롤러 : 'HeaderController'
},
'userInfo@contacts': {
TemplateUrl : '보기/연락처/userInfo.html',
컨트롤러 : 'userinfocontroller'
},
'map@contacts': {
TemplateUrl : '보기/연락처/map.html',
컨트롤러 : 'MapController'
},
'검색@contacts': {
TemplateUrl : '보기/contacts/search.html',
컨트롤러 : 'SearchUserController'
}
}
})
.STATE ( 'UCENTER', {
URL : '/ucenter',
보기 : {
'': {
TemplateUrl : 'views/ucenter/ucenter.html',
컨트롤러 : ''
},
'header@ucenter': {
templateUrl : 'views/header.html',
컨트롤러 : 'HeaderController'
},
'userweibo@ucenter': {
TemplateUrl : 'Views/ucenter/weibo.html',
컨트롤러 : 'ucweibocontroller'
},
'userDetailInfo@ucenter': {
TemplateUrl : 'views/ucenter/user.html',
컨트롤러 : 'UcuserController'
},
'바르@ucenter': {
templateUrl : 'views/footer.html',
컨트롤러 : ''
}
}
})
.STATE ( '기사', {
URL : '/article/: id',
보기 : {
'': {
TemplateUrl : '보기/기사/article.html',
컨트롤러 : ''
},
'header@article': {
templateUrl : 'views/header.html',
컨트롤러 : 'HeaderController'
},
'article_content@article': {
TemplateUrl : '보기/article/article_content.html',
컨트롤러 : 'ArticledeTailController'
},
'바닥기@article': {
templateUrl : 'views/footer.html',
컨트롤러 : ''
}
}
})
.state ( 'article_index', {
URL : '/article',
보기 : {
'': {
TemplateUrl : '보기/기사/article.html',
컨트롤러 : ''
},
'header@article_index': {
templateUrl : 'views/header.html',
컨트롤러 : 'HeaderController'
},
'article_content@article_index': {
TemplateUrl : '보기/article/article_content.html',
컨트롤러 : 'ArticledeTailController'
},
'f 것을@article_index': {
templateUrl : 'views/footer.html',
컨트롤러 : ''
}
}
});
}]);