Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 16 2019 18:39

    carlosandrebp on master

    upload email icon (compare)

  • Jan 15 2019 14:03

    carlosandrebp on master

    Icons update (compare)

  • Nov 13 2018 16:54
    hassankhan commented #3
  • Nov 02 2018 15:10
    hassankhan commented #3
  • Nov 02 2018 15:10
    hassankhan commented #3
  • Nov 01 2018 23:19
    hassankhan commented #3
  • Oct 29 2018 16:32
    hassankhan commented #3
  • Oct 24 2018 14:38
    hassankhan opened #3
  • Aug 14 2018 23:50

    carlosandrebp on master

    updates animations (compare)

  • Jul 19 2018 16:34
    brianneisler closed #1
  • Jul 19 2018 16:34
    brianneisler commented #1
  • Jul 18 2018 16:36

    andrepiresbp on master

    Updates (compare)

  • Jul 18 2018 15:50

    andrepiresbp on master

    Update (compare)

  • Jul 09 2018 19:25
    gornostal commented #59
  • Jul 09 2018 19:12
    maheshmasale commented #59
  • May 24 2018 23:39
    DavidWells removed as member
  • Feb 13 2018 19:40
    ivan-myob commented #54
  • Feb 08 2018 08:48
    julien2x opened #62
  • Dec 22 2017 16:14
    awcheng opened #61
  • Oct 23 2017 19:12
    dluu2015 closed #60
Abhinav Prakash
@abhinavsp0730
Hi @all. I'm very new to serverless. I've
tried to deploy my first express server to aws with serverless but I'm getting 502 gateway error. Would you Folks please help me🥺.
'''
Abhinav Prakash
@abhinavsp0730
Below is my app.js code

const serverless = require('serverless-http');
const express = require("express");
const qs = require("qs");
const bodyParser = require("body-parser");
const axios = require("axios");

const app = express();

//app.use(
//cors({
//origin: "https://xxx",
//})
//);
//
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(bodyParser.text());
app.use(bodyParser.raw());

// let corsOptions = {
// origin: "https://xxx",
// // allowedHeaders: [
// // "Content-Type",
// // "Authorization",
// // "Content-Length",
// // "X-Requested-With",
// // "Accept",
// // ],
// methods: ["GET", "PUT", "POST", "DELETE", "OPTIONS"],
// optionsSuccessStatus: 200, // some legacy browsers (IE11, various SmartTVs) choke on 204
// };

// // app.use(cors(corsOptions));

// const corsm = (req, res, next) => {
// res.header("Access-Control-Allow-Origin", "*");
// res.header("Access-Control-Allow-Methods", "GET, POST");
// res.header(
// "Access-Control-Allow-Headers",
// "Origin, X-Requested-With, Content-Type, Accept, Authorization"
// );
// next();
// };

// app.use(function (req, res, next) {
// res.setHeader(
// "Access-Control-Allow-Origin",
// "xxx"
// ); // update to match the domain you will make the request from
// res.setHeader(
// "Access-Control-Allow-Headers",
// "Origin, X-Requested-With, Content-Type, Accept"
// );
// next();
// });

// app.options(function (req, res, next) {
// res.setHeader(
// "Access-Control-Allow-Origin",
// "xxxx"
// ); // update to match the domain you will make the request from
// res.setHeader(
// "Access-Control-Allow-Headers",
// "Origin, X-Requested-With, Content-Type, Accept"
// );
// next();
// });

app.post("/punctuate", async (req, res) => {
console.log("called");
let { text } = req.body;

text = text.replace(/\b((Applause)|(Laughter)|(thank you))\b/g, match => "");

text = text.replace(/[()|`|-|``|'']/g, "");

text = text.replace(/\s+/g, " ").trim();
try {
    const data = await axios({
        method: "post",
        url: "https://xxxx",
        data: qs.stringify({ text }),
        headers: {
            "content-type": "application/x-www-form-urlencoded;charset=utf-8",
            "Access-Control-Allow-Origin": "*",
        },
    });

    res.status(200).json({ text: JSON.stringify(data.data) });
} catch (error) {
    console.log(error.response);
    res.json({ text: "" });
}

});

app.post("/summary", async (req, res) => {
let talk = req.body;

const result = await axios({
    url: "https://xxxx",
    method: "post",
    headers: {
        "Content-Type": "text/plain",
    },
    data: talk,
});

res.status(200).send(result.data.summary);

});

// app.listen(8080, () => {
// console.log("server started 🚀,port 8080");
// });
module.exports.handler = serverless(app);

Ross Coundon
@rcoundon

Below is my app.js code

Hi - it's really hard to follow that as it's not formatted properly and there's lots that's commented out. It might be more readable if you set it up as a gist or codepen, or similar and link to it so we can help

Abhinav Prakash
@abhinavsp0730
@rcoundon Thanks ross. It's working now . But I'm able to do a post request using a curl command. But when I'm testing the API with fetch I'm getting cors error(CORS Missing Allow origin). But I haven't enabled cors while deploying in Aws Api gateway and in aws lamba also?
Chester O'Neill
@ThrowsException
Ive been looking into ways to bundle a serverless node application. I see serverless-webpack has the option for includeModules but is there a reason that you wouldn't just want webpack to bundle/treeshake everything for you and just output a single file?
epanfile
@epanfile
anyone know of instructions on how to debug the serverless framework code? more specifically, I am interested in extending the amplify-appsync-simulator plugin. How can I debug the code I am writing in this plugin?
Himanshu Joshi
@himharsh1997
Error: Body must be a string. Received: undefined.
getting this error on doing setup of aws appsync in serverless
Ross Coundon
@rcoundon

@rcoundon Thanks ross. It's working now . But I'm able to do a post request using a curl command. But when I'm testing the API with fetch I'm getting cors error(CORS Missing Allow origin). But I haven't enabled cors while deploying in Aws Api gateway and in aws lamba also?

Hi - you can specify cors on the http event:

    events:
      - http:
          path: somepath
          method: post
          cors: true

But you also need to return the necessary CORS headers from your lambda function.
For example, you could define a function to add the necessary headers to your returned objects something like

export function addCorsHeaders(response: APIGatewayProxyResult): APIGatewayProxyResult {
  if (!response.headers) {
    response.headers = {};
  }
  response.headers['Access-Control-Allow-Headers'] = 'Content-Type';
  response.headers['Access-Control-Allow-Origin'] = '*';
  response.headers['Access-Control-Allow-Methods'] = 'OPTIONS,POST,GET,PATCH,PUT,DELETE';

  return response;
}

Then you'd use it like:

const response = {
        statusCode: 200,
        body: JSON.stringify({
          message: 'some data',
        }),
      };
return addCorsHeaders(response);
Ross Coundon
@rcoundon

Ive been looking into ways to bundle a serverless node application. I see serverless-webpack has the option for includeModules but is there a reason that you wouldn't just want webpack to bundle/treeshake everything for you and just output a single file?

includeModules just gives you some options around including/excluding certain packages. For example, you might use something that is OS specific like sharp for local testing but not want this bundled in the package, so you can then use includeModules/forceExclude with sharp. Also, if you wanted to be specific about what to include you can use forceInclude, maybe you might want to do that with aws-sdk rather than use the version that lambda containers automatically include

ค๓เՇ
@amitizle_twitter

Hello, can someone please advise if the following makes sense?

functions:
  myCloudWatch:
    handler: myCloudWatch.handler
    events:
      - cloudwatchEvent:
          event:
            arn: "arn:aws:events:us-east-1:123456789012:rule/MyScheduledRule"
            source:
              - 'aws.events'
            detail-type:
              - 'Scheduled Event'

Generally I want to grant the λ function with a permission to be invoked by some scheduled rules, which are dynamic and therefore cannot be defined in the configuration yaml.
Thanks

nbouliol
@nbouliol
Hello, does anyone have a working example of deploying a lambda in a vpc to have a static ip ?
clmn
@JacksonGariety
I put cors: true in the function config in my serverless.yaml, but the browser still complains that the response to the preflight request "does not have HTTP ok status."
clmn
@JacksonGariety
I tried sending an OPTIONS request with curl and I got "internal server error"
Gareth McCumskey
@garethmcc
@JacksonGariety Can you share your serverless.yml config?
John Mikel Regida
@johnmikel
Hi guys, I'm trying to deploy nextjs in serverless using the plugin and I am getting a weird error - ReferenceError: window is not defined. Does anyone know where to start in solving this?
John Mikel Regida
@johnmikel
solved this using nextjs' dynamic imports
Yusuf Kanchwala
@kanchwala-yusuf
Hi Guys,
Can anyone please let me know if Azure Event Grid is supported as an event source in the serverless framework?
Manpreet Singh
@manpoffc
Hi Guys, I'm new here. Looking forward to contributing.
Alexandre Lemaire
@Saeven
Hey guys! Quick new-to-this question for you. Am using serverless through bref.sh; serverless deploy is failing with s3:CreateBucket Access Denied; can I specify the bucket that gets used somehow, such that the bucket can be created beforehand? For policy reasons (we work in a highly regulated industry), we can't allow auto-creation in access keys that are available to devs.
Kevin Piazzoli Felix Perez
@kevin4dhd
Hello guys, I hope you have a good day, my question is the following, as I create more tables with the aws-dynamodb component, if someone could give me the answer I would be very grateful, I have been stuck for several days.
Aws-dynamodb link: https://github.com/serverless-components/aws-dynamodb
Ross Coundon
@rcoundon
@JacksonGariety you need to return the necessary headers from your lambda too
r_mohan
@r_mohan_twitter
How versatile is the VTL in the gateway ? Can I populate a error JSON and return 400 when validation fails ? It should all happen within the VTL.
Tyler Compton
@velovix
Hi everyone. I'm trying to write a plugin that operates on AWS resources after they're created, but I'm not sure how to get the IDs or ARNs of these resources. If I pass !Ref MyResourceto my plugin, I just get a simple object: {Ref: MyResource} instead of the result of the function. If I look up the resource by name in serverless.service.resources.Resources[], I get all the information I provided in the CloudFront template, but not the ID or ARN.
pradeepkusingh
@pradeepkusingh
Team, I am trying to implement canary deployment using serverless framework, do we have any sample to follow?
Gareth McCumskey
@garethmcc
@pradeepkusingh I believe this is what you need: https://www.youtube.com/watch?v=umsaXWrpgR8
pradeepkusingh
@pradeepkusingh
thanks @garethmcc
not interested in politics :)
Alex Metzger
@ametzger
anyone got a sec for a funky problem? I'm trying to run a Python lambda but it seems like whenever I run sls deploy the package is getting uploaded with my python files present but truncated
Alex Metzger
@ametzger
looks like it might be darwin-specific, I'm just using a docker container and everything seems happy
MeetupFeed
@MeetupFeedio_twitter
Hey guys, we've created a selection of 2020's most relevant Serverless-related meetup videos, covering a bunch of hot topics, including the present and future of Serverless, migrating existing applications to Serverless, building brand new ones from scratch, and how Serverless can improve a team's productivity. You can read it here: https://blog.meetupfeed.io/serverless-meetup-videos-2020/
Felipe Campelo
@fccampelo
Can anyone tell me if the lambda's memory consumption is shared with its intentions?
juandans01
@juandans01
Hi! so i'm having a really weird issue, the serverless cli it's not working, at all, the only command that works is help, all the other things get stalled, maybe something is down ? i'm really confused of what's happening, any help is appreciated
Ghost
@ghost~60111b45d73408ce4ff9d7c6
Hi Everyone
Can anyone suggest best document / website for converting php monolithic app to Cloud Agnostic App? we are using AWS Cloud.
Praneet Rattan
@praneetrattan
Hello! I anyone else having issues recving slack alert notifications in case of invocation failures? We have had our setup for the past year, and after Jan 26th we haven't recvd any alerts. I added a new notification channel but yet no avail!
Any help would be appreciated.
catastrophicsoftware
@catastrophicsoftware
image.png
Shouldn't there be arm templates in the template store? I cannot for the life of me find any arm templates. But I am seeing that they should exist
Kevin Mitchell
@kevin-mitchell

Hi all! QQ: re: serverless-offline- it's been a while tbqh since I've looked at / used serverless, but it used to be that (at least in theory!) serverless-offline supported more vendors than AWS. I am specifically interested in IBM OpenWhisk, and more specifically I want to get OpenWhisk running locally / "offline" along with TypeScript transpilation. I've had this working in the past (~2 years ago) with a bit of work (I had to fork the serverless-typescript-plugin to add sequence support at the time - https://github.com/kevin-mitchell/serverless-plugin-typescript/tree/develpr/add-openwhisk-sequence-support).... but now it seems like the serverless offline stuff is really only geared towards use with AWS?

That's a lot of words, sorry I could have probably said this in a sentence. I can't help add color sometimes!

jptcnde
@jptcnde
hello there, needs help, any recommendation and guide on how to increase performance for my lambda? like caching? please link sample code or config also,
sathishmohan-ps
@sathishmohan-ps
Hi All,
Could someone point me to the template for Azure Functions Nodejs TypeScript version using Serverless ?
Thanks in Advance !!!
Pedro Gomes
@Lusitaniae

Serverless: Checking deployment create progress...
.
Error --------------------------------------------------

Error: Deployment failed: RESOURCE_ERROR

   {"ResourceType":"storage.v1.bucket","ResourceErrorCode":"400","ResourceErrorMessage":{"code":400,"errors":[{"domain":"global","message":"Invalid Value","reason":"invalid"}],"message":"Invalid Value","statusMessage":"Bad Request","requestPath":"https://storage.googleapis.com/storage/v1/b","httpMethod":"POST"}}
I keep getting this error, I tried changing service name a few times (possible name collusion from what I read on GH issues?)
service name is just word-word-word-word no strange characters
Pedro Gomes
@Lusitaniae
finally find out, I was writing the wrong region name, from looking at deployment manager logs
clmn
@JacksonGariety
How do I organize my resources in AWS? I want to group them into projects and set my budget by project. Or is it easier to create multiple AWS accounts?
clmn
@JacksonGariety
It looks like you can create tags and break down your AWS receipt by tag. But how do you tag your resources in serverless?
Andreas Kohn
@ankon
@JacksonGariety it depends on the type of resource. You can use serverless' stackTags (see https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/), and most AWS resources have a way to also specify per-resource tags (see the CloudFormation documentation for the resources in question). Some AWS resources do not support tagging (yet).