Skip to content

Commit

Permalink
fix: build deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-lemon committed Jul 19, 2019
1 parent 3fd9677 commit e1c8035
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ branches:
install:
- npm install
script:
- npm run build
- npm run test
env:
- CODECOV_TOKEN="0cd44aea-7596-4f0c-b830-110c85fd9d3d"
after_success:
- "./node_modules/.bin/codecov"
- npm run build
# deploy on master
deploy:
provider: npm
Expand Down
22 changes: 22 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* factory of express()
*
* @param {*} env environment config like `process.env`
*/
const express = env => {
const $express = require(`./dist/express`);
return $express;
};

/**
* factory of handler()
*
* @param {*} env environment config like `process.env`
*/
const handler = env => {
const $handler = require('./handler');
return $handler;
};

//! export default
module.exports = { express, handler };
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "lemon-hello-api",
"version": "1.0.3",
"version": "1.0.3a",
"description": "Basic Serverless Hello API with `Lambda` + `API Gateway` + `Web Socket` + `SNS` + `SQS` + `KMS`",
"main": "handler.js",
"main": "dist/index.js",
"scripts": {
"!build": "build /src to /dist",
"build": "babel src --out-dir dist",
"build": "babel ./src --out-dir ./dist --verbose",
"start": "nodemon --watch src --exec babel-node src/express.js",
"!server": "----- local에서 serverless로 실행하기 (개발용) -----",
"server": "sls offline start --stage local --port 8888",
Expand Down

0 comments on commit e1c8035

Please sign in to comment.