Skip to content
Snippets Groups Projects
Commit 03645ca3 authored by Henrique Varella Ehrenfried's avatar Henrique Varella Ehrenfried :speech_balloon:
Browse files

First commit

parents
No related branches found
No related tags found
No related merge requests found
Showing with 288 additions and 0 deletions
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
/client/
\ No newline at end of file
{
"extends": "loopback"
}
\ No newline at end of file
*.csv
*.dat
*.iml
*.log
*.out
*.pid
*.seed
*.sublime-*
*.swo
*.swp
*.tgz
*.xml
.DS_Store
.idea
.project
.strong-pm
coverage
node_modules
npm-debug.log
{
"generator-loopback": {}
}
\ No newline at end of file
# My Application
The project is generated by [LoopBack](http://loopback.io).
\ No newline at end of file
## Client
This is the place for your application front-end files.
'use strict';
module.exports = function(Category) {
};
{
"name": "category",
"plural": "categories",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"category_name": {
"type": "string"
},
"category_description": {
"type": "string"
}
},
"validations": [],
"relations": {
"locations":{
"type": "hasMany",
"model": "geolocation",
"foreignKey": "category_id"
}
},
"acls": [],
"methods": {}
}
'use strict';
module.exports = function(Endser) {
};
{
"name": "end_user",
"plural": "end_users",
"base": "User",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"email": {
"type": "string",
"required": true
},
"password": {
"type": "string",
"required": true
},
"permission": {
"type": "string",
"required": true
},
"registration": {
"type": "string"
}
},
"validations": [],
"relations": {
"locations":{
"type": "hasMany",
"model": "geolocation",
"foreignKey": "user_id"
}
},
"acls": [],
"methods": {}
}
'use strict';
module.exports = function(Geolocation) {
};
{
"name": "geolocation",
"plural": "geolocations",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"category_id": {
"type": "number",
"required": true
},
"geolocation_name": {
"type": "string",
"required": true
},
"latitude": {
"type": "number",
"postgresql":{
"dataType":"float"
},
"required": true
},
"longitude": {
"type": "number",
"postgresql":{
"dataType":"float"
},
"required": true
},
"android_id": {
"type": "string"
},
"when_sent": {
"type": "date"
},
"description_location": {
"type": "string"
},
"user_id": {
"type": "number",
"required": true
}
},
"validations": [],
"relations": {
"user":{
"type": "belongsTo",
"model": "end_user",
"foreignKey": "id"
},
"category":{
"type": "belongsTo",
"model": "category",
"foreignKey": "id"
}
},
"acls": [],
"methods": {}
}
This diff is collapsed.
{
"name": "SMPPIR-CheckIn-API",
"version": "1.0.0",
"main": "server/server.js",
"engines": {
"node": ">=4"
},
"scripts": {
"lint": "eslint .",
"start": "node .",
"posttest": "npm run lint && nsp check"
},
"dependencies": {
"compression": "^1.0.3",
"cors": "^2.5.2",
"helmet": "^3.12.1",
"loopback": "^3.0.0",
"loopback-boot": "^2.6.5",
"loopback-component-explorer": "^6.0.1",
"loopback-connector-postgresql": "^3.3.1",
"serve-favicon": "^2.0.1",
"strong-error-handler": "^2.0.0"
},
"devDependencies": {
"eslint": "^3.17.1",
"eslint-config-loopback": "^8.0.0",
"nsp": "^3.2.1"
},
"repository": {
"type": "",
"url": ""
},
"license": "UNLICENSED",
"description": "SMPPIR-CheckIn-API"
}
'use strict';
module.exports = function enableAuthentication(server) {
// enable authentication
// server.enableAuth();
};
// module.exports = function(app) {
// 'use strict';
// var db = app.dataSources.SMPPIR_CheckIn2;
// console.log('-- Models found:', Object.keys(app.models));
// db.autoupdate(Object.keys(app.models), function() {
// console.log('Auto-migrated model:\n\t' +
// Object.keys(app.models).join('\n\t') +
// '\nsuccessfully.');
// });
// };
'use strict';
var util = require('util');
var _ = require('lodash');
module.exports = function(app) {
var db = app.dataSources.SMPPIR_CheckIn2;
db.autoupdate(function(err) {
if (err) throw err;
console.log('\nAutomigrate completed');
});
};
'use strict';
module.exports = function(server) {
// Install a `/` route that returns server status
var router = server.loopback.Router();
router.get('/', server.loopback.status());
server.use(router);
};
{
"loopback-component-explorer": {
"mountPath": "/explorer"
}
}
{
"restApiRoot": "/api",
"host": "0.0.0.0",
"port": 3000,
"remoting": {
"context": false,
"rest": {
"handleErrors": false,
"normalizeHttpPath": false,
"xml": false
},
"json": {
"strict": false,
"limit": ""
},
"urlencoded": {
"extended": true,
"limit": ""
},
"cors": false
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment