Skip to content
This repository was archived by the owner on Sep 11, 2021. It is now read-only.

Commit d0f84c1

Browse files
committed
Packaged
1 parent 45bc99d commit d0f84c1

File tree

5 files changed

+1427
-16
lines changed

5 files changed

+1427
-16
lines changed
53.1 MB
Binary file not shown.
53.2 MB
Binary file not shown.

javascript/PMH/package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
22
"name": "filteringapi",
33
"version": "1.0.0",
4-
"main": "index.js",
4+
"main": "./src/index.js",
55
"license": "MIT",
66
"scripts": {
7-
"start": "node index.js"
7+
"start": "node ./src/index.js",
8+
"build": "pkg ."
9+
},
10+
"bin": {
11+
"app": "./src/index.js"
812
},
913
"dependencies": {
1014
"chalk": "^2.4.2",
@@ -13,5 +17,8 @@
1317
"hangul-js": "^0.2.5",
1418
"is-alphabetical": "^1.0.3",
1519
"nanoid": "^2.0.3"
20+
},
21+
"devDependencies": {
22+
"pkg": "^4.4.0"
1623
}
1724
}
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const markup = require('chalk')
1515
const express = require('express')
1616

1717
/** Dialogflow Module */
18-
process.env.GOOGLE_APPLICATION_CREDENTIALS = './lib/BadWordsFilter-e34ed9d4dd5b.json'
18+
process.env.GOOGLE_APPLICATION_CREDENTIALS = '../lib/BadWordsFilter-e34ed9d4dd5b.json'
1919
const dialogflowId = 'badwordsfilter-esqgxe'
2020
const dialogflow = require('dialogflow')
2121

@@ -35,7 +35,7 @@ const dialogflowClient = new dialogflow.SessionsClient()
3535
const app = express()
3636

3737
/** Bad Words DataBase */
38-
const DB = require('../../public/BadWords.json')
38+
const DB = require('../../../public/BadWords.json')
3939

4040
/** Memory */
4141
let temp = {}
@@ -45,12 +45,18 @@ app.get('/', (req, res) => {
4545
temp = {
4646
name: 'FilteringAPI',
4747
description: '이 API는 웹 전용 REST API입니다',
48-
uses: '/check/<문장>'
48+
사용법: '/check/<문장>',
49+
종료하려면: '/stop/'
4950
}
5051
res.send(temp)
5152
console.log(markup.green.underline('RESPONSE') + ' ' + markup.green(JSON.stringify(temp)))
5253
})
5354

55+
app.get('/stop', (req, res) => {
56+
res.send("정상적으로 종료되었습니다")
57+
process.exit()
58+
})
59+
5460
app.get('/check/:query', (req, res) => {
5561
console.log(markup.cyan.underline('REQUEST') + ' ' + markup.cyan(req.ip + ' ' + req.protocol + ' ' + req.path))
5662

0 commit comments

Comments
 (0)