Last active
September 17, 2019 11:14
-
-
Save dennbagas/67a37609ac203190da3c77d6e5f27a27 to your computer and use it in GitHub Desktop.
Membuat weather API dengan Node.js
This file contains 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
var express = require('express'); | |
const bodyParser = require('body-parser'); | |
const cors = require('cors'); | |
var app = express(); | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({ extended: false })); | |
app.use(cors()); | |
app.get('/', function (req, res) { | |
res.send('Hello World!'); | |
}); | |
app.listen(4000, function () { | |
console.log('Example app listening on port 4000!'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment