node js return json
var http = require('http');
var app = http.createServer(function(req,res){
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify({ a: 1 }));
});
app.listen(3000);
// > {"a":1}
Also in JavaScript:
- hide checkbox jquery
- lodash map
- how to draw a flower in javascript
- for in and for of in js
- javascript how to check if image exists
- variables 2 python .Bartolome sintes Marco
- manifest.json chrome
- node js event emitter
- js open link onmouseup
- how to convert jsonobject to json string in java
- summernote mentions ajax
- conditional rendering alert if input fields are empty
- javascript includes
- get latest file from s3 bucket javascript
- make string json object vue
- javascript get array of class names
- javascript date countdown
- get top items from json object
- content type json
- generate random number javascript
- return an array of strings from an array of objects js
- javascript Count the occurrences of a value in an array
- unban command discord.js v12
- angular interview questions