简体   繁体   中英

Cannot GET / expo react

在此处输入图像描述 I'm trying to connect to stripe server using express framework but I keep getting this error in the image I attached above.

import express from "express";

const app = express();
const port = 3000;
const PUBLISHABLE_KEY = "pk_test......";
const SECRET_KEY = "sk_test.........";


app.listen(port, () => {
    console.log(`Example app listening at http://localhost:${port}`);
});

You have not did a GET method. Try to do - above the listening:

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

Now, when you call http://localhost:3000/ you will see Hello World .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM