Created
August 5, 2019 15:10
-
-
Save 2pai/a0ef5f6b27e1981e6246e13e66039914 to your computer and use it in GitHub Desktop.
for medium
This file contains hidden or 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 express = require("express"); | |
const app = new express(); | |
const controller = require('./controller'); | |
const port = 8025; | |
const bodyParser = require('body-parser'); | |
app.enable('trust proxy'); // agar bisa mengakses IP user | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({extended: true})); | |
app.get('/api/getInfoIP',controller.getIPInfo) | |
app.get('/api/getBanner',controller.getBanner) | |
app.post('/api/postBanner',controller.postBanner) | |
app.listen(port); | |
console.log('Server Run At : localhost:'+port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment