DEV Community

loading...

Hello World Web server in Flask vs Express

victoromondi1997 profile image VICTOR OMONDI ・1 min read

Flask

from flask import Flask

app = Flask(__name__)

@app.route('/')
def index():
    return "<h1>Hello World!</h1>"

app.run(None, 3001, True)

Express

const express = require('express');

const app = express();

app.get('/', (req, res) => {
    return res.send('<h1>Hello World!</h1>');
});

app.listen(3000);

Discussion (0)

pic
Editor guide