1。話す
ある日、クラスモニターは、学生が私に場所を共有できるアドレス帳を開発してほしいと言ったので、単に機能を自分で設計しただけだと言いました。ユーザーの役割、Weiboへの投稿、場所の共有などを含みます。今回は少し利己的でした。私の最近視聴されたAngularjsを行使するために、私はnode.js + mongodb + angular.jsソリューションを決定的に選択しました。もちろん、node.jsを開発する経験はますます深刻になりつつあります。昨年、リーダーは、ノードの各サービスを1つのビジネス機能のみをサポートして、維持する方が便利になるようにしようとするべきだと言ったことを忘れないでください。当時、私は本当にノードサービスを非常に強力にしたかったのです。今、リーダーのアプローチは正しいようであり、私はノードサービス機能を選出することを好みます...
2。ドライグッズを直接アップロードします
データベースサービスはAlibaba Cloudに展開されます。静的ファイルサーバーはGitHubページを使用します。
GitHubプロジェクトアドレス:https://github.com/vczero/ourtimes
オンラインエクスペリエンスアドレス:http://vczero.github.io/tuban/main.html#/
私はボールを言う写真を持っていません、私に2つのスクリーンショットを見せてください:
(1)ホームページ
(2)アドレス帳
......オンラインでの経験...
iii。プロジェクト
合計プロジェクト:https://github.com/vczero/ourtimes
必要なサービスを開発しました:https://github.com/vczero/ourtimes/tree/master/server
Web PCクライアントを開きます:https://github.com/vczero/ourtimes/tree/master/client-web
簡単なバックエンド管理システムが開発されました:https://github.com/vczero/ourtimes/tree/master/client-admin
誰もがフォーク、フォロー、共有コードを歓迎し、協力してフロントエンドを構築します。
4。web-pc端末の角度のエントリファイルコードを添付します
コードコピーは次のとおりです。
var app = angular.module( 'app'、['ui.router'、 'ngcookies']);
var server_base_url = 'http://127.0.0.1:3000/';
//構成を初期化します
app.run(['$ rotscope'、function($ rotscope){
$ rootscope.appname = 'tuban.com';
$ rootscope.desc = 'ロケーションベースのアドレス帳';
$ rootscope.author = 'Ghost Rumor';
$ rotscope._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/login'、
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/get self'、
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=ad925c5003760094713775d64748d872&callback=init'
});
// json parse
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 key in data){
obj.push(key + '=' + data [key]);
}
obj.join( '&');
}];
}]);
//ルーティング構成
app.config(['$ stateprovider'、 '$ urlrouterprovider'、
function($ stateProvider、$ urlrouterprovider){
/*urlルーティング*/
$ urlRouterProvider.OtherWise( "/");
/*ステータス構成*/
$ stateProvider
//フロントページ
.state( 'index'、{
URL: '/'、
ビュー:{
'':{
TemplateUrl: 'Views/index/index.html'、
}、
'header@index':{
TemplateUrl: 'Views/header.html'、
コントローラー:「HeaderController」
}、
'footer@index':{
TemplateUrl: 'Views/Footer.html'、
コントローラー: ''
}、
'weibo@index':{
TemplateUrl: 'Views/index/weibo.html'、
コントローラー:「weibocontroller」
}、
'article@index':{
TemplateUrl: 'Views/index/article.html'、
コントローラー:「articlecontroller」
}、
'post@index」:{
TemplateUrl: 'Views/index/post.html'、
コントローラー:「ポストワイボコントローラー」
}
}
})
.state( 'login'、{
url: '/login'、
ビュー:{
'':{
TemplateUrl: 'Views/login/login.html'、
コントローラー:「logincontroller」
}
}
})
.State( 'Register'、{
URL: '/Register'、
ビュー:{
'':{
TemplateUrl: 'Views/Register/Register.html'、
コントローラー:「RegisterController」
}
}
})
.state( 'contacts'、{
url: '/contacts'、
ビュー:{
'':{
TemplateUrl: 'Views/Contacts/Contacts.html'、
コントローラー: ''
}、
'header@contacts':{
TemplateUrl: 'Views/header.html'、
コントローラー:「HeaderController」
}、
'userinfo@contacts':{
TemplateUrl: 'Views/Contacts/userinfo.html'、
コントローラー:「userinfocontroller」
}、
'map@contacts':{
TemplateUrl: 'Views/Contacts/map.html'、
コントローラー:「MapController」
}、
「@連絡先を検索」:{
TemplateUrl: 'Views/Contacts/search.html'、
コントローラー:「SearchUserController」
}
}
})
.state( 'ucenter'、{
url: '/ucenter'、
ビュー:{
'':{
TemplateUrl: 'Views/ucenter/ucenter.html'、
コントローラー: ''
}、
'ヘッダー@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( 'article'、{
url: '/article/:id'、
ビュー:{
'':{
TemplateUrl: 'Views/article/article.html'、
コントローラー: ''
}、
'header@article':{
TemplateUrl: 'Views/header.html'、
コントローラー:「HeaderController」
}、
'article_content@article':{
TemplateUrl: 'Views/article/article_content.html'、
コントローラー:「articledetailcontroller」
}、
'footer@article':{
TemplateUrl: 'Views/Footer.html'、
コントローラー: ''
}
}
})
.state( 'article_index'、{
url: '/article'、
ビュー:{
'':{
TemplateUrl: 'Views/article/article.html'、
コントローラー: ''
}、
'header@article_index':{
TemplateUrl: 'Views/header.html'、
コントローラー:「HeaderController」
}、
'article_content@article_index':{
TemplateUrl: 'Views/article/article_content.html'、
コントローラー:「articledetailcontroller」
}、
'footer@article_index':{
TemplateUrl: 'Views/Footer.html'、
コントローラー: ''
}
}
});
}]);