Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • hvehrenfried/Loopback-API-Example
  • SMPPIR/Loopback-API-Example
2 results
Select Git revision
Show changes
Commits on Source (2)
FROM node:latest
RUN apt-get -y update -qq && apt-get install -y -qq apt-utils tree
COPY . .
RUN npm install
EXPOSE 4001
CMD npm start
\ No newline at end of file
...@@ -72,3 +72,29 @@ The result will be something similar to: ...@@ -72,3 +72,29 @@ The result will be something similar to:
"category_name": "Categoria teste", "category_name": "Categoria teste",
"category_description": "Categoria usada para testar funcionalidades" "category_description": "Categoria usada para testar funcionalidades"
} }
```
## Deploy on SMPPIRHOMOLOGA
Whenever you are ready to deploy, please change the `datasources.json` with the `datasources.json.homologa`.
After that, you can use the Docker image:
Para criar a imagem nova
`sudo docker build --tag mapping-api .`
Para exportar a imagem
`sudo docker save -o ~/mapping-api.tar mapping-api`
Para importar a image
`sudo docker load -i ~/mapping-api.tar `
Para rodar a imagem
`sudo docker run -d --rm -p 4001:4001 --net="host" --name mapping-api mapping-api`
:warning: O `-d` significa daemon, não quiser que o comando de rodar imagem rode em segundo plano, remova este argumento :warning:
\ No newline at end of file
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
'use strict'; 'use strict';
module.exports = function(Category) { module.exports = function(Category) {
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
'use strict'; 'use strict';
module.exports = function(EndUser) { module.exports = function(EndUser) {
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
'use strict'; 'use strict';
module.exports = function(Geolocation) { module.exports = function(Geolocation) {
......
const URL = 'http://localhost:3000/api/'; /*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
const URL = 'http://localhost:4001/api/';
const randomLowerCase = function() { const randomLowerCase = function() {
let possible = 'abcdefghijklmnopqrstuvwxyz'; let possible = 'abcdefghijklmnopqrstuvwxyz';
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
/* /*
2 Permissions : admin, user 2 Permissions : admin, user
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
'use strict'; 'use strict';
module.exports = function enableAuthentication(server) { module.exports = function enableAuthentication(server) {
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function(server) { module.exports = function(server) {
var remotes = server.remotes(); var remotes = server.remotes();
// modify all returned values // modify all returned values
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
// module.exports = function(app) { // module.exports = function(app) {
// 'use strict'; // 'use strict';
// var db = app.dataSources.SMPPIR_CheckIn2; // var db = app.dataSources.SMPPIR_CheckIn2;
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
'use strict'; 'use strict';
module.exports = function(server) { module.exports = function(server) {
......
{ {
"restApiRoot": "/api", "restApiRoot": "/api",
"host": "0.0.0.0", "host": "0.0.0.0",
"port": 3000, "port": 4001,
"remoting": { "remoting": {
"context": false, "context": false,
"rest": { "rest": {
......
{
"db": {
"name": "db",
"connector": "memory"
},
"SMPPIR_CheckIn2": {
"host": "localhost",
"port": 5432,
"url": "postgres://smppir:123mudar@localhost:5432/smppir_checkin?ssl=false",
"database": "smppir_checkin",
"password": "123mudar",
"name": "SMPPIR_CheckIn2",
"connector": "postgresql",
"user": "postgres",
"ssl": false
}
}
\ No newline at end of file
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
'use strict'; 'use strict';
var loopback = require('loopback'); var loopback = require('loopback');
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
var chakram = require('chakram'), expect = chakram.expect; var chakram = require('chakram'), expect = chakram.expect;
var env = require('../enviroment'); var env = require('../enviroment');
const URL = env.URL; const URL = env.URL;
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
var chakram = require('chakram'), expect = chakram.expect; var chakram = require('chakram'), expect = chakram.expect;
var env = require('../enviroment'); var env = require('../enviroment');
const URL = env.URL; const URL = env.URL;
......
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-CheckIn.
SMPPIR-CheckIn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-CheckIn is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-CheckIn. If not, see <https://www.gnu.org/licenses/>.
*/
var chakram = require('chakram'), expect = chakram.expect; var chakram = require('chakram'), expect = chakram.expect;
var env = require('../enviroment'); var env = require('../enviroment');
const URL = env.URL; const URL = env.URL;
......