Initial commit
This commit is contained in:
commit
1660cde4d4
6 changed files with 182 additions and 0 deletions
109
.gitignore
vendored
Normal file
109
.gitignore
vendored
Normal file
|
@ -0,0 +1,109 @@
|
|||
|
||||
# Created by https://www.gitignore.io/api/node,linux,osx,windows,appengine
|
||||
|
||||
### Node ###
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules
|
||||
jspm_packages
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
|
||||
### Linux ###
|
||||
*~
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
|
||||
### OSX ###
|
||||
*.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
|
||||
### Windows ###
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
|
||||
### AppEngine ###
|
||||
# Google App Engine generated folder
|
||||
appengine-generated/
|
3
.jshintrc
Normal file
3
.jshintrc
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"esnext": true
|
||||
}
|
6
app.js
Normal file
6
app.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
'use strict';
|
||||
var serverModule = require('./server/server');
|
||||
|
||||
var server = serverModule.getInstance();
|
||||
|
||||
server.run();
|
17
app.yaml
Normal file
17
app.yaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Copyright 2015-2016, Google, Inc.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# [START app_yaml]
|
||||
runtime: nodejs
|
||||
vm: true
|
||||
# [END app_yaml]
|
16
package.json
Normal file
16
package.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "the_social_notework",
|
||||
"version": "0.0.1",
|
||||
"description": "A sample Back ent for an Android app",
|
||||
"main": "app.js",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node app.js"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.14.0"
|
||||
}
|
||||
}
|
31
server/server.js
Normal file
31
server/server.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
'use strict';
|
||||
var server;
|
||||
var express = require('express');
|
||||
|
||||
|
||||
|
||||
class Server {
|
||||
constructor() {
|
||||
console.log('Pin');
|
||||
this.app = express();
|
||||
this.app.get('/', (req, res) => {
|
||||
res.status(200)
|
||||
.send('Hello, world - PIN PIN PIN!');
|
||||
});
|
||||
}
|
||||
|
||||
run() {
|
||||
var _server = this.app.listen(process.env.PORT || '8080', () => {
|
||||
console.log('App listening on port %s', _server.address()
|
||||
.port);
|
||||
console.log('Press Ctrl+C to quit.');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.getInstance = () => {
|
||||
if (!server) {
|
||||
server = new Server();
|
||||
}
|
||||
return server;
|
||||
};
|
Loading…
Reference in a new issue