This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
firstname: { | |
type: string, | |
access:[ | |
{ usertype: 1, range: 'none', accessType: 2 }, | |
{ usertype: 4, range: 'none', accessType: 2 }, | |
{ usertype: 5, range: 'any', accessType: 3 }, | |
{ usertype: 9, range: 'any', accessType: 4 }, | |
{ usertype: 10, range: 'any', accessType: 4 } // | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
yarn-debug.log* | |
yarn-error.log* | |
# Runtime data | |
pids | |
*.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"start": "node index.js" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const supertest = require('supertest'); | |
const server = require('./index'); | |
const chai = require('chai'); | |
chai.should(); | |
const api = supertest.agent(server); | |
describe('Add method', () => { | |
it('should connect to the Server', (done) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
// Our function which adds two numbers and returns the result | |
const addNumbers = (firstNumber, secondNumber) => { | |
// check that input is a number | |
if (typeof(Number(firstNumber)) !== 'number' || typeof(Number(secondNumber)) !== 'number') { | |
return 'Values should be integer or numbers' | |
} | |
return Number(firstNumber) + Number(secondNumber); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Node docker image on which this would be run | |
image: node:8.10.0 | |
cache: | |
paths: | |
- node_modules/ | |
stages: | |
- test | |
- deploy_production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const { json, urlencoded } = express; | |
const app = express(); | |
app.use(json()); | |
app.use(urlencoded({ extended: true })); | |
app.get('/', (req, res) => { | |
return res.status(200).send({ | |
message: 'Welcome to our API' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const { json, urlencoded } = express; | |
const app = express(); | |
app.use(json()); | |
app.use(urlencoded({ extended: true })); | |
app.get('/', (req, res) => { | |
return res.status(200).send({ | |
message: 'Welcome to our API' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWS_ACCESS_KEY_ID='YOUR_AWS_ID' | |
AWS_SECRET_ACCESS_KEY='YOUR_AWS_SECRET_KEY' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require('aws-sdk'); | |
const dotenv = require('dotenv'); | |
dotenv.config(); | |
AWS.config.update({ | |
accessKeyId: process.env.AWS_ACCESS_KEY_ID, | |
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY | |
}); |
OlderNewer