Created
August 9, 2018 06:00
Star
You must be signed in to star a gist
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
const appName = require('./base'); // Dùng module base.js | |
const { ajax, show } = require('./util'); // Dùng module util.js | |
async function register(username) { | |
// Sử dụng hàm ajax và show của module util | |
await ajax.post('/register', { username }); | |
show(`Welcome ${username} to ${appName}`); | |
} | |
// Các module khác có thể dùng hàm register của module này | |
module.exports = { register }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment