Skip to content

Commit ffd5429

Browse files
author
Gal Bashan
committed
[main] Adding serverless deployment
1 parent a0b2b18 commit ffd5429

File tree

4 files changed

+494
-4
lines changed

4 files changed

+494
-4
lines changed

app.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
const express = require('express');
22
const got = require('got');
3-
const WEATHER_API_URL = 'https://node-congress.workshop.epsagon.com/weather';
4-
const NEWS_API_URL = 'https://node-congress.workshop.epsagon.com/news';
5-
const FACT_API_URL = 'https://node-congress.workshop.epsagon.com/fact';
3+
const slshttp = require('serverless-http')
4+
5+
const WEATHER_API_URL = 'https://weather.node-congress.workshop.epsagon.com/weather';
6+
const NEWS_API_URL = 'https://news.node-congress.workshop.epsagon.com/news';
7+
const FACT_API_URL = 'https://facts.node-congress.workshop.epsagon.com/facts';
68

79

810
function getWeather(city = '') {
@@ -37,5 +39,7 @@ app.use('*', (req, res) => {
3739
})
3840
app.listen(3000, () => console.log('App is now online at port 3000'));
3941

42+
module.exports.handler = slshttp(app)
43+
4044

4145

0 commit comments

Comments
 (0)