Untitled

mail@pastecode.io avatar
unknown
javascript
2 months ago
457 B
1
Indexable
Never
// Make HTTP Requests programatically
const axios = require('axios');

// Pull environment variables from .env file
require('dotenv').config();

// Get original file contents
async function getRawFile(filePath) {
    const getResult = await axios({
    	method: 'get',
    	url: `https://git.nmlv.nml.com/api/v4/projects/{project Id here}/repository/files/${filePath}/raw`,
    	headers: {
    		'PRIVATE-TOKEN': process.env.PRIVATE_TOKEN,
    	},
    });
}
Leave a Comment