Skip to content

Instantly share code, notes, and snippets.

@AshikNesin
Last active March 5, 2017 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshikNesin/37933de9395c6b7b045f9e4389a90f15 to your computer and use it in GitHub Desktop.
Save AshikNesin/37933de9395c6b7b045f9e4389a90f15 to your computer and use it in GitHub Desktop.
Kickstart a Node Project (with ES6 Import)
{
"presets": ["es2015"],
"plugins": [
"add-module-exports"
]
}
import express from 'express'
const app = express()
app.get('/',(req,res)=>{
res.send({msg:'It works 🔥'})
})
app.listen(3000)
export default app
npm init -y
yarn add babel-register babel-plugin-add-module-exports babel-preset-es2015 dotenv body-parser
var env = process.env.NODE_ENV || 'development'
if (env === 'development' || env === 'test') {
require("babel-register");
}
exports = module.exports = require('./app')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment