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
service: hello-world | |
frameworkVersion: '2' | |
provider: | |
name: azure # Serverless sağlayıcı adı | |
region: West US 2 # Uygulamanın dağıtılacağı lokasyon | |
runtime: nodejs12 # Nodejs versiyonu | |
environment: |
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
{ | |
"bindings": [{ | |
"authLevel": "anonymous", | |
"type": "httpTrigger", | |
"direction": "in", | |
"name": "req", | |
"methods": [ | |
"post" | |
], | |
"route": "users" |
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 userService = require('../services/user'); | |
module.exports = async function(context, req) { | |
context.log('JavaScript HTTP trigger function processed a request.'); | |
if (req.body && req.body.user) { | |
context.res = { | |
status: 200, | |
body: userService.addUser(context) | |
}; |
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
{ | |
"bindings": [ | |
{ | |
"authLevel": "anonymous", | |
"type": "httpTrigger", | |
"direction": "in", | |
"name": "req", | |
"methods": [ | |
"get" | |
], |
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 userService = require('../services/user'); | |
module.exports = async function (context, req) { | |
context.log('JavaScript HTTP trigger function processed a request.'); | |
context.res = { | |
status: 200, | |
body: userService.getUsers(context) | |
}; | |
}; |
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 data = require('./data.js'); | |
module.exports = { | |
getUsers: function(context) { | |
try { | |
const users = data.getUsers(); | |
context.res.status(200).json(users); | |
} catch (error) { | |
context.res.status(500).send(error); | |
} |
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 data = { | |
users: [ | |
{ | |
id: 1, | |
name: 'user 1', | |
status: 'approved' | |
}, | |
{ | |
id: 2, | |
task: 'user 2', |
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
using System; | |
using System.Collections.Generic; | |
using System.Data.Entity; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using Common.Extensions; | |
using AutoMapper; | |
namespace Repository | |
{ |